Skip to content

Commit db9ba7d

Browse files
committed
Upgrade phpstan
1 parent 136fcfd commit db9ba7d

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"nette/utils": "^3.0 || ^4.0",
2828
"nikic/php-parser": "^4.0",
2929
"nyholm/symfony-bundle-test": "^3.0",
30-
"phpstan/phpstan": "~1.10.67",
30+
"phpstan/phpstan": "~2.0.0",
3131
"psalm/phar": "~5.14.1",
3232
"psr/cache": "^1.0 || ^2.0 || ^3.0",
3333
"swaggest/json-diff": "^3.7",

phpstan.neon.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
parameters:
22
level: 6
33
treatPhpDocTypesAsCertain: false
4-
checkMissingCallableSignature: true
5-
checkMissingIterableValueType: false
64
reportUnmatchedIgnoredErrors: false
75
paths:
86
- src
@@ -13,5 +11,6 @@ parameters:
1311
- src/**/tests/*
1412

1513
ignoreErrors:
14+
- identifier: missingType.iterableValue
1615
- '#PHPDoc tag @throws with type Psr\\Cache\\CacheException is not subtype of Throwable$#'
1716
- '#^Dead catch - JsonException is never thrown in the try block\.$#'

src/CodeGenerator/src/Generator/OperationGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ public function generate(Operation $operation): void
116116
$method->addComment('@see ' . $documentation);
117117
}
118118
$method->addComment('@see ' . $operation->getApiReferenceDocumentationUrl());
119-
if (null !== $prefix = $operation->getService()->getEndpointPrefix()) {
120-
$method->addComment('@see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-' . $prefix . '-' . $operation->getService()->getApiVersion() . '.html#' . strtolower($operation->getName()));
121-
}
119+
$prefix = $operation->getService()->getEndpointPrefix();
120+
$method->addComment('@see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-' . $prefix . '-' . $operation->getService()->getApiVersion() . '.html#' . strtolower($operation->getName()));
122121
[$doc, $memberClassNames] = $this->typeGenerator->generateDocblock($inputShape, $inputClass, true, false, false, [' \'@region\'?: string|null,']);
123122
$method->addComment($doc);
124123
foreach ($memberClassNames as $memberClassName) {

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,10 @@ private function createPopulateMethod(string $functionName, string $body, Shape
366366
->setType(\SimpleXMLElement::class)
367367
;
368368

369-
if (null !== $shape) {
370-
[$returnType, $parameterType, $memberClassNames] = $this->typeGenerator->getPhpType($shape);
371-
$method
372-
->setComment('@return ' . $parameterType);
373-
$this->imports = array_merge($this->imports, $memberClassNames);
374-
}
369+
[$returnType, $parameterType, $memberClassNames] = $this->typeGenerator->getPhpType($shape);
370+
$method
371+
->setComment('@return ' . $parameterType);
372+
$this->imports = array_merge($this->imports, $memberClassNames);
375373

376374
return $method;
377375
}

src/CodeGenerator/src/Generator/TestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function generateInput(Operation $operation, StructureShape $shape): voi
102102

103103
break;
104104
case 'query':
105-
$stub = substr(var_export($exampleInput ? (\is_array($exampleInput) ? http_build_query($exampleInput, '', '&', \PHP_QUERY_RFC3986) : $exampleInput) : "
105+
$stub = substr(var_export($exampleInput ? http_build_query($exampleInput, '', '&', \PHP_QUERY_RFC3986) : "
106106
Action={$operation->getName()}
107107
&Version={$operation->getApiVersion()}
108108
", true), 1, -1);

src/Core/src/Signer/SignerV4.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ private function buildCanonicalQuery(Request $request): string
330330
continue;
331331
}
332332

333+
// @phpstan-ignore argument.unresolvableType
333334
sort($values);
334335
foreach ($values as $value) {
335336
$encodedQuery[] = rawurlencode($key) . '=' . rawurlencode($value);

0 commit comments

Comments
 (0)