phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

fix: Fix PHPStan errors on level 9

Open siketyan opened this issue 2 years ago • 0 comments

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                                                                                                         

siketyan avatar Feb 20 '23 03:02 siketyan