phpstan-symfony
phpstan-symfony copied to clipboard
fix: Fix PHPStan errors on level 9
Fixed some errors on PHPStan level 9.
As Is:
❯ vendor/bin/phpstan analyse src --level 9
Note: Using configuration file /Users/siketyan/.local/src/github.com/phpstan/phpstan-symfony/phpstan.neon.
54/54 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ ------------------------------------------------------------------------------------------------------------------
Line Symfony/Configuration.php
------ ------------------------------------------------------------------------------------------------------------------
21 Method PHPStan\Symfony\Configuration::getContainerXmlPath() should return string|null but returns mixed.
26 Method PHPStan\Symfony\Configuration::hasConstantHassers() should return bool but returns mixed.
31 Method PHPStan\Symfony\Configuration::getConsoleApplicationLoader() should return string|null but returns mixed.
------ ------------------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line Type/Symfony/ParameterDynamicReturnTypeExtension.php
------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
166 Parameter #2 $value of method PHPStan\Type\Symfony\ParameterDynamicReturnTypeExtension::generalizeTypeFromValue() expects array|bool|float|int|string, mixed given.
177 Parameter #2 $value of method PHPStan\Type\Symfony\ParameterDynamicReturnTypeExtension::generalizeTypeFromValue() expects array|bool|float|int|string, mixed given.
------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 5 errors
To Be:
❯ vendor/bin/phpstan analyse src --level 9
Note: Using configuration file /Users/siketyan/.local/src/github.com/phpstan/phpstan-symfony/phpstan.neon.
54/54 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] No errors