Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactor code to meet modern coding requirements #8

Open
gregor-j opened this issue Mar 21, 2024 · 0 comments
Open

Refactor code to meet modern coding requirements #8

gregor-j opened this issue Mar 21, 2024 · 0 comments

Comments

@gregor-j
Copy link

Even at level 2 PHPStan returns 8 errors:

 ------ ----------------------------------------------------------------------------------- 
  Line   src/JsonRPC/Request/RequestBuilder.php                                             
 ------ ----------------------------------------------------------------------------------- 
  48     Unsafe usage of new static().                                                      
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   src/JsonRPC/Request/RequestParser.php                                              
 ------ ----------------------------------------------------------------------------------- 
  59     Unsafe usage of new static().                                                      
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   src/JsonRPC/Response/ResponseBuilder.php                                           
 ------ ----------------------------------------------------------------------------------- 
  89     Unsafe usage of new static().                                                      
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------------------- 
  Line   src/JsonRPC/Response/ResponseParser.php                                            
 ------ ----------------------------------------------------------------------------------- 
  42     Unsafe usage of new static().                                                      
         💡 See: https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static  
 ------ ----------------------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------- 
  Line   src/JsonRPC/Validator/HostValidator.php                          
 ------ ----------------------------------------------------------------- 
  71     Binary operation "-" between 32 and string results in an error.  
 ------ ----------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------- 
  Line   tests/Validator/HostValidatorTest.php                                                             
 ------ -------------------------------------------------------------------------------------------------- 
  12     Static method JsonRPC\Validator\HostValidator::validate() invoked with 3 parameters, 2 required.  
  17     Static method JsonRPC\Validator\HostValidator::validate() invoked with 3 parameters, 2 required.  
  31     Static method JsonRPC\Validator\HostValidator::validate() invoked with 3 parameters, 2 required.  
 ------ -------------------------------------------------------------------------------------------------- 

Serious code changes will be required to fix these issues.

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

No branches or pull requests

1 participant