Skip to content

Commit b78e037

Browse files
Merge branch 'async-aws:master' into master
2 parents 3141539 + 4718c47 commit b78e037

File tree

8 files changed

+31
-29
lines changed

8 files changed

+31
-29
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.340.1"
3+
"${LATEST}": "3.340.4"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

psalm.baseline.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,6 @@
246246
<code><![CDATA[list<Reason::*>]]></code>
247247
</MoreSpecificReturnType>
248248
</file>
249-
<file src="src/Service/Route53/src/Result/CreateHostedZoneResponse.php">
250-
<PossiblyNullPropertyAssignmentValue>
251-
<code><![CDATA[$headers['location'][0] ?? null]]></code>
252-
</PossiblyNullPropertyAssignmentValue>
253-
</file>
254249
<file src="src/Service/S3/src/Result/ListObjectsV2Output.php">
255250
<LessSpecificReturnStatement>
256251
<code>$items</code>
@@ -331,5 +326,5 @@
331326
<code><![CDATA[list<KeyAgreementAlgorithmSpec::*>]]></code>
332327
<code><![CDATA[list<SigningAlgorithmSpec::*>]]></code>
333328
</MoreSpecificReturnType>
334-
</file>
329+
</file>
335330
</files>

src/CodeGenerator/src/Generator/CodeGenerator/PopulatorGenerator.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,39 +190,39 @@ private function generatePopulator(Operation $operation, StructureShape $shape,
190190
$memberShape = $member->getShape();
191191
switch ($memberShape->getType()) {
192192
case 'timestamp':
193-
$body .= strtr('$this->PROPERTY_NAME = isset($headers["LOCATION_NAME"][0]) ? new \DateTimeImmutable($headers["LOCATION_NAME"][0]) : null;' . "\n", [
194-
'PROPERTY_NAME' => $propertyName,
195-
'LOCATION_NAME' => $locationName,
196-
]);
193+
$propertyValue = 'new \DateTimeImmutable($headers["LOCATION_NAME"][0])';
197194

198195
break;
199196
case 'integer':
200197
case 'long':
201-
$body .= strtr('$this->PROPERTY_NAME = isset($headers["LOCATION_NAME"][0]) ? (int) $headers["LOCATION_NAME"][0] : null;' . "\n", [
202-
'PROPERTY_NAME' => $propertyName,
203-
'LOCATION_NAME' => $locationName,
204-
]);
198+
$propertyValue = '(int) $headers["LOCATION_NAME"][0]';
205199

206200
break;
207201
case 'boolean':
208202
$this->requirementsRegistry->addRequirement('ext-filter');
209203

210-
$body .= strtr('$this->PROPERTY_NAME = isset($headers["LOCATION_NAME"][0]) ? filter_var($headers["LOCATION_NAME"][0], FILTER_VALIDATE_BOOLEAN) : null;' . "\n", [
211-
'PROPERTY_NAME' => $propertyName,
212-
'LOCATION_NAME' => $locationName,
213-
]);
204+
$propertyValue = 'filter_var($headers["LOCATION_NAME"][0], FILTER_VALIDATE_BOOLEAN)';
214205

215206
break;
216207
case 'string':
217-
$body .= strtr('$this->PROPERTY_NAME = $headers["LOCATION_NAME"][0] ?? null;' . "\n", [
218-
'PROPERTY_NAME' => $propertyName,
219-
'LOCATION_NAME' => $locationName,
220-
]);
208+
$propertyValue = '$headers["LOCATION_NAME"][0]';
221209

222210
break;
223211
default:
224212
throw new \RuntimeException(\sprintf('Type %s is not yet implemented', $memberShape->getType()));
225213
}
214+
if (!$member->isRequired()) {
215+
if ('$headers["LOCATION_NAME"][0]' === $propertyValue) {
216+
$propertyValue .= '?? null';
217+
} else {
218+
$propertyValue = 'isset($headers["LOCATION_NAME"][0]) ? ' . $propertyValue . ' : null';
219+
}
220+
}
221+
222+
$body .= strtr('$this->PROPERTY_NAME = ' . $propertyValue . ';' . "\n", [
223+
'PROPERTY_NAME' => $propertyName,
224+
'LOCATION_NAME' => $locationName,
225+
]);
226226
}
227227

228228
// This will catch arbitrary values that exists in undefined "headers"

src/Service/Route53/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions
88

9+
### Changed
10+
11+
- trust AWS's API response: And not check if required headers are present
12+
913
## 2.6.0
1014

1115
### Added

src/Service/Route53/src/Result/CreateHostedZoneResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function populateResult(Response $response): void
9090
{
9191
$headers = $response->getHeaders();
9292

93-
$this->location = $headers['location'][0] ?? null;
93+
$this->location = $headers['location'][0];
9494

9595
$data = new \SimpleXMLElement($response->getContent());
9696
$this->hostedZone = $this->populateResultHostedZone($data->HostedZone);

src/Service/Ssm/src/Exception/ParameterNotFoundException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
/**
88
* The parameter couldn't be found. Verify the name and try again.
9+
*
10+
* > For the `DeleteParameter` and `GetParameter` actions, if the specified parameter doesn't exist, the
11+
* > `ParameterNotFound` exception is *not* recorded in CloudTrail event logs.
912
*/
1013
final class ParameterNotFoundException extends ClientException
1114
{

src/Service/Ssm/src/Input/PutParameterRequest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
final class PutParameterRequest extends Input
1414
{
1515
/**
16-
* The fully qualified name of the parameter that you want to add to the system.
16+
* The fully qualified name of the parameter that you want to create or update.
1717
*
1818
* > You can't enter the Amazon Resource Name (ARN) for a parameter, only the parameter name itself.
1919
*
@@ -71,7 +71,7 @@ final class PutParameterRequest extends Input
7171
private $value;
7272

7373
/**
74-
* The type of parameter that you want to add to the system.
74+
* The type of parameter that you want to create.
7575
*
7676
* > `SecureString` isn't currently supported for CloudFormation templates.
7777
*
@@ -89,8 +89,8 @@ final class PutParameterRequest extends Input
8989
* The Key Management Service (KMS) ID that you want to use to encrypt a parameter. Use a custom key for better
9090
* security. Required for parameters that use the `SecureString` data type.
9191
*
92-
* If you don't specify a key ID, the system uses the default key associated with your Amazon Web Services account which
93-
* is not as secure as using a custom key.
92+
* If you don't specify a key ID, the system uses the default key associated with your Amazon Web Services account,
93+
* which is not as secure as using a custom key.
9494
*
9595
* - To use a custom KMS key, choose the `SecureString` data type with the `Key ID` parameter.
9696
*

src/Service/Ssm/src/SsmClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function getParametersByPath($input): GetParametersByPathResult
203203
}
204204

205205
/**
206-
* Add a parameter to the system.
206+
* Create or update a parameter in Parameter Store.
207207
*
208208
* @see https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PutParameter.html
209209
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-ssm-2014-11-06.html#putparameter

0 commit comments

Comments
 (0)