Skip to content

Commit 0447e84

Browse files
committed
Add strict comparison null !== instead of !
1 parent 136fcfd commit 0447e84

File tree

96 files changed

+258
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+258
-158
lines changed

src/CodeGenerator/src/Generator/PaginationGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ private function generateOutputPaginationLoader(string $iterator, string $common
207207
if (!$moreResult) {
208208
$moreCondition = '';
209209
foreach ($outputToken as $property) {
210-
$moreCondition .= $this->generateGetter('$page', $property, (bool) $common);
210+
$moreCondition .= 'null !== '.$this->generateGetter('$page', $property, (bool) $common);
211+
break;
211212
}
212213
} else {
213214
$moreCondition = $this->generateGetter('$page', $moreResult, (bool) $common);

src/CodeGenerator/src/Generator/ResponseParser/RestXmlParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private function parseXmlResponseStructure(StructureShape $shape, string $input,
215215
return strtr('REQUIRED new CLASS_NAME([
216216
PROPERTIES
217217
])', [
218-
'REQUIRED' => $required ? '' : '!' . $input . ' ? null : ',
218+
'REQUIRED' => $required ? '' : 'null === ' . $input . ' ? null : ',
219219
'CLASS_NAME' => $this->namespaceRegistry->getObject($shape)->getName(),
220220
'PROPERTIES' => implode("\n", $properties),
221221
]);
@@ -321,7 +321,7 @@ private function parseXmlResponseList(ListShape $shape, string $input, bool $req
321321
'INPUT_PROPERTY' => $shape->isFlattened() ? '$xml' : ('$xml->' . ($shapeMember->getLocationName() ? $shapeMember->getLocationName() : 'member')),
322322
]), $shape);
323323

324-
return strtr($required ? '$this->FUNCTION_NAME(INPUT)' : '!INPUT ? EMPTY : $this->FUNCTION_NAME(INPUT)', [
324+
return strtr($required ? '$this->FUNCTION_NAME(INPUT)' : 'null === INPUT ? EMPTY : $this->FUNCTION_NAME(INPUT)', [
325325
'EMPTY' => !$inObject ? '[]' : 'null',
326326
'INPUT' => $input,
327327
'FUNCTION_NAME' => $functionName,
@@ -349,7 +349,7 @@ private function parseXmlResponseMap(MapShape $shape, string $input, bool $requi
349349
'MAP_ACCESSOR' => $this->parseXmlElement('$a', $shapeValue->getShape(), true, $inObject),
350350
]), $shape);
351351

352-
return strtr($required ? '$this->FUNCTION_NAME(INPUT)' : '!INPUT ? EMPTY : $this->FUNCTION_NAME(INPUT)', [
352+
return strtr($required ? '$this->FUNCTION_NAME(INPUT)' : 'null === INPUT ? EMPTY : $this->FUNCTION_NAME(INPUT)', [
353353
'EMPTY' => !$inObject ? '[]' : 'null',
354354
'INPUT' => $input,
355355
'FUNCTION_NAME' => $functionName,

src/Core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Changed
1010

11+
- use strict comparison `null !==` instead of `!`
1112
- Fix CS
1213

1314
## 1.22.1

src/Core/src/Signer/SignerV4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ private function buildCanonicalQuery(Request $request): string
317317
$query = $request->getQuery();
318318

319319
unset($query['X-Amz-Signature']);
320-
if (!$query) {
320+
if (empty($query)) {
321321
return '';
322322
}
323323

src/Core/src/Sts/Result/AssumeRoleResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ protected function populateResult(Response $response): void
9494
$data = new \SimpleXMLElement($response->getContent());
9595
$data = $data->AssumeRoleResult;
9696

97-
$this->credentials = !$data->Credentials ? null : new Credentials([
97+
$this->credentials = null === $data->Credentials ? null : new Credentials([
9898
'AccessKeyId' => (string) $data->Credentials->AccessKeyId,
9999
'SecretAccessKey' => (string) $data->Credentials->SecretAccessKey,
100100
'SessionToken' => (string) $data->Credentials->SessionToken,
101101
'Expiration' => new \DateTimeImmutable((string) $data->Credentials->Expiration),
102102
]);
103-
$this->assumedRoleUser = !$data->AssumedRoleUser ? null : new AssumedRoleUser([
103+
$this->assumedRoleUser = null === $data->AssumedRoleUser ? null : new AssumedRoleUser([
104104
'AssumedRoleId' => (string) $data->AssumedRoleUser->AssumedRoleId,
105105
'Arn' => (string) $data->AssumedRoleUser->Arn,
106106
]);

src/Core/src/Sts/Result/AssumeRoleWithWebIdentityResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ protected function populateResult(Response $response): void
147147
$data = new \SimpleXMLElement($response->getContent());
148148
$data = $data->AssumeRoleWithWebIdentityResult;
149149

150-
$this->credentials = !$data->Credentials ? null : new Credentials([
150+
$this->credentials = null === $data->Credentials ? null : new Credentials([
151151
'AccessKeyId' => (string) $data->Credentials->AccessKeyId,
152152
'SecretAccessKey' => (string) $data->Credentials->SecretAccessKey,
153153
'SessionToken' => (string) $data->Credentials->SessionToken,
154154
'Expiration' => new \DateTimeImmutable((string) $data->Credentials->Expiration),
155155
]);
156156
$this->subjectFromWebIdentityToken = ($v = $data->SubjectFromWebIdentityToken) ? (string) $v : null;
157-
$this->assumedRoleUser = !$data->AssumedRoleUser ? null : new AssumedRoleUser([
157+
$this->assumedRoleUser = null === $data->AssumedRoleUser ? null : new AssumedRoleUser([
158158
'AssumedRoleId' => (string) $data->AssumedRoleUser->AssumedRoleId,
159159
'Arn' => (string) $data->AssumedRoleUser->Arn,
160160
]);

src/Service/AppSync/CHANGELOG.md

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

33
## NOT RELEASED
44

5+
### Changed
6+
7+
- use strict comparison `null !==` instead of `!`
8+
59
## 3.0.0
610

711
### BC-BREAK

src/Service/AppSync/src/Result/ListApiKeysResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getApiKeys(bool $currentPageOnly = false): iterable
5353
$page = $this;
5454
while (true) {
5555
$page->initialize();
56-
if ($page->nextToken) {
56+
if (null !== $page->nextToken) {
5757
$input->setNextToken($page->nextToken);
5858

5959
$this->registerPrefetch($nextPage = $client->listApiKeys($input));

src/Service/AppSync/src/Result/ListResolversResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getResolvers(bool $currentPageOnly = false): iterable
7575
$page = $this;
7676
while (true) {
7777
$page->initialize();
78-
if ($page->nextToken) {
78+
if (null !== $page->nextToken) {
7979
$input->setNextToken($page->nextToken);
8080

8181
$this->registerPrefetch($nextPage = $client->listResolvers($input));

src/Service/Athena/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: Removing FEDERATED from Create/List/Delete/GetDataCatalog API
88

9+
### Changed
10+
11+
- use strict comparison `null !==` instead of `!`
12+
913
## 2.3.0
1014

1115
### Added

0 commit comments

Comments
 (0)