The generated code tries to use a @var annotation to override the type:
|
$body = '/** @var \DateTimeImmutable $d */ $d = \DateTimeImmutable::createFromFormat(\'U.u\', \sprintf(\'%.6F\', INPUT))'; |
But this does not actually work in Psalm or phpstan.
For Psalm, we have some baseline entries for it:
|
<file src="src/Service/StepFunctions/src/Result/StartExecutionOutput.php"> |
|
<PossiblyFalsePropertyAssignmentValue> |
|
<code><![CDATA[$d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $data['startDate']))]]></code> |
|
</PossiblyFalsePropertyAssignmentValue> |
|
</file> |
|
<file src="src/Service/StepFunctions/src/Result/StopExecutionOutput.php"> |
|
<PossiblyFalsePropertyAssignmentValue> |
|
<code><![CDATA[$d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $data['stopDate']))]]></code> |
|
</PossiblyFalsePropertyAssignmentValue> |
|
</file> |
For phpstan, it is not reported because we run it at level 6 while it is a level 7 error. But phpstan also reports it when enabling the rule:
https://phpstan.org/r/703f04fc-5f50-490b-a3c1-7707275aed22 (this includes variants of the comment to see whether they would have worked).
We should find a better way to generate this code so that generated code does not require updating the baseline when such usage appears.
The generated code tries to use a
@varannotation to override the type:aws/src/CodeGenerator/src/Generator/ResponseParser/JsonRpcParser.php
Line 19 in 77164a2
But this does not actually work in Psalm or phpstan.
For Psalm, we have some baseline entries for it:
aws/psalm.baseline.xml
Lines 65 to 74 in 77164a2
For phpstan, it is not reported because we run it at level 6 while it is a level 7 error. But phpstan also reports it when enabling the rule:
https://phpstan.org/r/703f04fc-5f50-490b-a3c1-7707275aed22 (this includes variants of the comment to see whether they would have worked).
We should find a better way to generate this code so that generated code does not require updating the baseline when such usage appears.