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

Bug: cannot resolve Services::xxx() #4220

Closed
kenjis opened this issue Feb 3, 2021 · 3 comments · Fixed by #4225
Closed

Bug: cannot resolve Services::xxx() #4220

kenjis opened this issue Feb 3, 2021 · 3 comments · Fixed by #4225
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@kenjis
Copy link
Member

kenjis commented Feb 3, 2021

Describe the bug

$request = Services::request();

PhpStorm says:

Method 'request' not found in \Config\Services

PHPStan says:

phpstan: Call to an undefined static method Config\Services::request().

CodeIgniter 4 version
develop branch, 4.0.5, 4.1.1

Affected module(s)
Services

Expected behavior, and steps to reproduce if appropriate
No errors on static analysis.

Context

  • OS: [macOS 10.15.7]
  • Web server [PHP built-in]
  • PHP version [7.4.13]
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 3, 2021
@iRedds
Copy link
Collaborator

iRedds commented Feb 3, 2021

Now App\Config\Services extends from CodeIgniter\Config\BaseServices instead of CodeIgniter\Config\Services
Even if the IDE does not see the method, it will still be called.

@kenjis
Copy link
Member Author

kenjis commented Feb 3, 2021

This is because of #3943

@kenjis
Copy link
Member Author

kenjis commented Feb 3, 2021

The problem is I have to see yellow code in PhpStorm.
My CI build is broken, because PHPStan reports many errors.

kenjis added a commit to kenjis/CodeIgniter4 that referenced this issue Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants