-
Notifications
You must be signed in to change notification settings - Fork 15
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
docs: add annotation for phpstan
#19
Conversation
Before ------ ---------------------------------------------------------------------------------------------------------------
Line ShieldOAuthConfig.php
------ ---------------------------------------------------------------------------------------------------------------
20 Property Datamweb\ShieldOAuth\Config\ShieldOAuthConfig::$oauthConfigs type has no value type specified in
iterable type array.
π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
56 Property Datamweb\ShieldOAuth\Config\ShieldOAuthConfig::$usersColumnsName type has no value type specified in
iterable type array.
π‘ See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
------ --------------------------------------------------------------------------------------------------------------- After 1/1 [============================] 100%
[OK] No errors |
Before: > phpstan analyze src/Config/Registrar.php
1/1 [============================] 100%
------ ----------------------------------------------------------------------------------------------------------------------
Line Registrar.php
------ ----------------------------------------------------------------------------------------------------------------------
30 Method Datamweb\ShieldOAuth\Config\Registrar::View() 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
------ ----------------------------------------------------------------------------------------------------------------------
[ERROR] Found 1 error After: > phpstan analyze src/Config/Registrar.php
1/1 [============================] 100%
[OK] No errors |
Co-authored-by: MGatner <mgatner@icloud.com>
β¦to docs-remove-phpstan-issues
Before: P:\WorkApp\cv472\vendor\datamweb\shield-oauth>composer analyze src\Config\Services.php
1/1 [============================] 100%
------ --------------------------------------------------------------------------------------------------
Line Services.php
------ --------------------------------------------------------------------------------------------------
21 Method Datamweb\ShieldOAuth\Config\Services::ShieldOAuth() has no return type specified.
21 Method Datamweb\ShieldOAuth\Config\Services::ShieldOAuth() has parameter $getShared with no type
specified.
27 Class Datamweb\ShieldOAuth\Libraries\Basic\ShieldOAuth does not have a constructor and must be
instantiated without any parameters.
------ -------------------------------------------------------------------------------------------------- After: > phpstan analyze src\Config\Services.php
Note: Using configuration file P:\WorkApp\cv472\vendor\datamweb\shield-oauth\phpstan.neon.dist.
1/1 [============================] 100%
[OK] No errors
|
Co-authored-by: MGatner <mgatner@icloud.com> docs: fix phpstan error from `Config/Services.php`
β¦to docs-remove-phpstan-issues
657cee4
to
e6d16ee
Compare
Before: ------ ---------------------------------------------------
Line Routes.php
------ ---------------------------------------------------
14 Variable $routes might not be defined.
15 Cannot call method allOAuth() on mixed.
18 Cannot access property $call_back_route on mixed.
------ ---------------------------------------------------
[ERROR] Found 3 errors After: > phpstan analyze --xdebug src/Config/Routes.php
Note: Using configuration file P:\WorkApp\cv472\vendor\datamweb\shield-oauth\phpstan.neon.dist.
1/1 [============================] 100%
[OK] No errors I got help from kenjis & paulbalandan , so thanks to them. |
bcebc1a
to
b53baa3
Compare
Before: ------ ----------------------------------------------------
Line ShieldOAuthModel.php
------ ----------------------------------------------------
28 Cannot access property $usersColumnsName on mixed.
29 Cannot access property $usersColumnsName on mixed.
30 Cannot access property $usersColumnsName on mixed.
------ ---------------------------------------------------- After: 0/1 [>---------------------------] 0%
[OK] No errors |
Before: ------ ----------------------------------------------------------------------------------------------------
Line 2022-10-20-182737_ShieldOAuth.php
------ ----------------------------------------------------------------------------------------------------
24 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$first_name.
24 Cannot access property $usersColumnsName on mixed.
25 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$last_name.
25 Cannot access property $usersColumnsName on mixed.
26 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$avatar.
26 Cannot access property $usersColumnsName on mixed.
32 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$first_name.
37 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$last_name.
42 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$avatar.
56 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$first_name.
57 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$last_name.
58 Access to an undefined property Datamweb\ShieldOAuth\Database\Migrations\ShieldOAuth::$avatar.
------ ----------------------------------------------------------------------------------------------------
[ERROR] Found 12 errors After: 1/1 [============================] 100%
[OK] No errors |
Before: > phpstan analyze --xdebug src\Libraries\Basic\ControllersInterface.php
1/1 [============================] 100%
------ -----------------------------------------------------------------------------------------------------------------
Line ControllersInterface.php
------ -----------------------------------------------------------------------------------------------------------------
19 Method Datamweb\ShieldOAuth\Libraries\Basic\ControllersInterface::redirectOAuth() has no return type specified.
21 Method Datamweb\ShieldOAuth\Libraries\Basic\ControllersInterface::callBack() has no return type specified.
------ -----------------------------------------------------------------------------------------------------------------
[ERROR] Found 2 errors After: > phpstan analyze --xdebug src\Libraries\Basic\ControllersInterface.php
1/1 [============================] 100%
[OK] No errors
|
Before: ------ ---------------------------------------------------------------------------------------------------------------------------------------
Line ShieldOAuth.php
------ ---------------------------------------------------------------------------------------------------------------------------------------
31 Call to an undefined static method CodeIgniter\Config\Factories::loadOAuth().
48 Cannot access property $psr4 on mixed.
72 Method Datamweb\ShieldOAuth\Libraries\Basic\ShieldOAuth::otherOAuth() 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
------ ---------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 3 errors After: 1/1 [============================] 100%
[OK] No errors Note:
I tried my best not to use |
Level 9 is too high.
$ XDEBUG_MODE=off phpstan analyse
...
------ -----------------------------------------------------------------------------------------------------------------------
Line Controllers/OAuthController.php
------ -----------------------------------------------------------------------------------------------------------------------
22 Return type mixed of method Datamweb\ShieldOAuth\Controllers\OAuthController::redirectOAuth() is not covariant with
return type CodeIgniter\HTTP\RedirectResponse of method
Datamweb\ShieldOAuth\Libraries\Basic\ControllersInterface::redirectOAuth().
48 Return type mixed of method Datamweb\ShieldOAuth\Controllers\OAuthController::callBack() is not covariant with return
type CodeIgniter\HTTP\RedirectResponse of method
Datamweb\ShieldOAuth\Libraries\Basic\ControllersInterface::callBack().
84 Parameter #1 $name of function model expects class-string<CodeIgniter\Model>, string given.
91 Call to an undefined method CodeIgniter\Model::findById().
94 Call to an undefined method CodeIgniter\Model::addToDefaultGroup().
124 Parameter #1 $name of function model expects class-string<CodeIgniter\Model>, string given.
126 Call to an undefined method CodeIgniter\Model::findByCredentials().
133 Parameter #1 $name of function model expects class-string<CodeIgniter\Model>, string given.
134 Call to an undefined method CodeIgniter\Model::findByCredentials().
147 Class Datamweb\ShieldOAuth\Controllers\LoginModel not found.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
147 Parameter #1 $name of function model expects class-string<CodeIgniter\Model>, string given.
149 Call to an undefined method CodeIgniter\Model::recordLoginAttempt().
------ -----------------------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------------------------
Line Libraries/Basic/AbstractOAuth.php
------ ---------------------------------------------------------------------------------------------
28 Access to an undefined property Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::$token.
33 Access to an undefined property Datamweb\ShieldOAuth\Libraries\Basic\AbstractOAuth::$token.
------ ---------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------------------------
Line Libraries/GithubOAuth.php
------ ---------------------------------------------------------------------------------------------
29 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client.
31 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
32 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$callbake_url.
33 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client_id.
34 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client_secret.
39 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$callbake_url.
39 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client_id.
46 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client.
48 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client_id.
49 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client_secret.
51 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$callbake_url.
59 Caught class Datamweb\ShieldOAuth\Libraries\Exception not found.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
60 Call to method getMessage() on an unknown class Datamweb\ShieldOAuth\Libraries\Exception.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
71 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$client.
79 Caught class Datamweb\ShieldOAuth\Libraries\Exception not found.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
80 Call to method getMessage() on an unknown class Datamweb\ShieldOAuth\Libraries\Exception.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
90 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
91 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
92 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
102 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
103 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
104 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GithubOAuth::$config.
108 Variable $usersColumnsName might not be defined.
------ ---------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------
Line Libraries/GoogleOAuth.php
------ -------------------------------------------------------------------------------------------
32 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$client.
34 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
49 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$client.
62 Caught class Datamweb\ShieldOAuth\Libraries\Exception not found.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
63 Call to method getMessage() on an unknown class Datamweb\ShieldOAuth\Libraries\Exception.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
74 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$client.
82 Caught class Datamweb\ShieldOAuth\Libraries\Exception not found.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
83 Call to method getMessage() on an unknown class Datamweb\ShieldOAuth\Libraries\Exception.
π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
93 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
94 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
95 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
106 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
107 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
108 Access to an undefined property Datamweb\ShieldOAuth\Libraries\GoogleOAuth::$config.
112 Variable $usersColumnsName might not be defined.
------ -------------------------------------------------------------------------------------------
[ERROR] Found 52 errors |
I try in this PR, To fix the errors identified by
phpstan
at level 9.This is my first experience, anyone please help.
π€¦ββοΈ all errors : 154