Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Fix PHPStan errors on level 9 #336

Open
wants to merge 2 commits into
base: 1.2.x
Choose a base branch
from

Conversation

siketyan
Copy link
Contributor

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                                                                                                         

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant