datamweb / shield-oauth

OAuth for CodeIgniter Shield
https://www.shield-oauth.codeigniter4.ir/
MIT License
61 stars 16 forks source link

chore: add PHPStan #45

Closed kenjis closed 1 year ago

kenjis commented 1 year ago

Supersedes #19

$ vendor/bin/phpstan
Note: Using configuration file .../shield-oauth/phpstan.neon.dist.
 19/19 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 [OK] No errors                                           

Ignored errors:

 ------ --------------------------------------------------------------------------------------------------------------------------- 
  Line   Commands/OAuthSetup.php                                                                                                    
 ------ --------------------------------------------------------------------------------------------------------------------------- 
  55     Property Datamweb\ShieldOAuth\Commands\OAuthSetup::$arguments type has no value type specified in iterable type array.     
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                  
  73     Property Datamweb\ShieldOAuth\Commands\OAuthSetup::$distPath has no type specified.                                        
  99     Method Datamweb\ShieldOAuth\Commands\OAuthSetup::copyAndReplace() has parameter $replaces with no value type specified in  
         iterable type array.                                                                                                       
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                  
 ------ --------------------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  Line   Config/Registrar.php                                                                                                        
 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  42     Method Datamweb\ShieldOAuth\Config\Registrar::Generators() return type has no value type specified in iterable type array.  
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                   
 ------ ---------------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------------------- 
  Line   Controllers/OAuthController.php                                                                                            
 ------ --------------------------------------------------------------------------------------------------------------------------- 
  111    Call to deprecated function random_string():                                                                               
         The type 'basic', 'md5', and 'sha1' are deprecated. They are not cryptographically secure.                                 
  123    Method Datamweb\ShieldOAuth\Controllers\OAuthController::checkExistenceUser() has parameter $find with no value type       
         specified in iterable type array.                                                                                          
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                  
  132    Method Datamweb\ShieldOAuth\Controllers\OAuthController::syncingUserInfo() has parameter $find with no value type          
         specified in iterable type array.                                                                                          
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                  
  132    Method Datamweb\ShieldOAuth\Controllers\OAuthController::syncingUserInfo() has parameter $updateFildes with no value type  
         specified in iterable type array.                                                                                          
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                  
  148    Class Datamweb\ShieldOAuth\Controllers\LoginModel not found.                                                               
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols                                                        
 ------ --------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------- 
  Line   Libraries/Basic/AbstractOAuth.php                                                                                        
 ------ ------------------------------------------------------------------------------------------------------------------------- 
  20     Method Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::fetchAccessTokenWithAuthCode() has parameter $allGet with no  
         value type specified in iterable type array.                                                                             
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                
  24     Method Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::setColumnsName() return type has no value type specified in   
         iterable type array.                                                                                                     
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                
  28     Access to an undefined property Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::$token.                              
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                                     
  33     Access to an undefined property Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::$token.                              
         💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property                                     
  36     Method Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::getUserInfo() has parameter $allGet with no value type        
         specified in iterable type array.                                                                                        
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                
  43     Method Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::getColumnsName() return type has no value type specified in   
         iterable type array.                                                                                                     
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                
 ------ ------------------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  Line   Libraries/GithubOAuth.php                                                                                                   
 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  21     Property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$API_CODE_URL has no type specified.                                   
  22     Property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$API_TOKEN_URL has no type specified.                                  
  23     Property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$API_USER_INFO_URL has no type specified.                              
  24     Property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$APPLICATION_NAME has no type specified.                               
  26     Property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client has no type specified.                                         
  27     Property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config has no type specified.                                         
  48     Method Datamweb\ShieldOAuth\Libraries\GithubOAuth::fetchAccessTokenWithAuthCode() has parameter $allGet with no value type  
         specified in iterable type array.                                                                                           
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                   
  92     Method Datamweb\ShieldOAuth\Libraries\GithubOAuth::setColumnsName() has parameter $userInfo with no type specified.         
  92     Method Datamweb\ShieldOAuth\Libraries\GithubOAuth::setColumnsName() return type has no value type specified in iterable     
         type array.                                                                                                                 
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                   
  106    Call to deprecated function random_string():                                                                                
         The type 'basic', 'md5', and 'sha1' are deprecated. They are not cryptographically secure.                                  
  114    Variable $usersColumnsName might not be defined.                                                                            
 ------ ---------------------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  Line   Libraries/GoogleOAuth.php                                                                                                   
 ------ ---------------------------------------------------------------------------------------------------------------------------- 
  21     Property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$API_CODE_URL has no type specified.                                   
  22     Property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$API_TOKEN_URL has no type specified.                                  
  23     Property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$API_USER_INFO_URL has no type specified.                              
  24     Property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$APPLICATION_NAME has no type specified.                               
  26     Property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$client has no type specified.                                         
  27     Property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config has no type specified.                                         
  48     Method Datamweb\ShieldOAuth\Libraries\GoogleOAuth::fetchAccessTokenWithAuthCode() has parameter $allGet with no value type  
         specified in iterable type array.                                                                                           
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                   
  92     Method Datamweb\ShieldOAuth\Libraries\GoogleOAuth::setColumnsName() has parameter $userInfo with no type specified.         
  92     Method Datamweb\ShieldOAuth\Libraries\GoogleOAuth::setColumnsName() return type has no value type specified in iterable     
         type array.                                                                                                                 
         💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type                                   
  107    Call to deprecated function random_string():                                                                                
         The type 'basic', 'md5', and 'sha1' are deprecated. They are not cryptographically secure.                                  
  115    Variable $usersColumnsName might not be defined.                                                                            
 ------ ---------------------------------------------------------------------------------------------------------------------------- 

 [ERROR] Found 37 errors