Skip to content

Commit 16bbf63

Browse files
authored
Upgrade phpstan (#1793)
1 parent 6b785ec commit 16bbf63

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

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/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/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);

0 commit comments

Comments
 (0)