Closed apasov closed 11 months ago
Same issue here, I've also tried to use https://github.com/barryvdh/laravel-ide-helper to make it work in PHPStorm.
No luck so far. I found this PR: https://github.com/GrahamCampbell/Laravel-GitHub/pull/106 which is referenced by this issue: https://github.com/GrahamCampbell/Laravel-GitHub/issues/144
Basically, I hard implemented the changes in the PR and that resolved the issue of the undefined static method
error. However, the code autocompletion is not working and now I see the following error: nonstatic method shouldn't be call statically
.
This is just a limitation of the IDE, and I feel is out of scope to fix here. Thanks anyway.
No, it's not just an IDE specific thing. First of all, it's a phpstan error.
As I already mentioned, phpstan says Call to an undefined static method GrahamCampbell\GitHub\Facades\GitHub::repo().
Currently I suppress it in phpstan.neon
:
parameters:
ignoreErrors:
- '#Call to an undefined static method GrahamCampbell\\GitHub\\Facades\\GitHub::[a-zA-Z0-9\\_]()#'
So I believe here is the exact place where it should be fixed.
I use this code and it works:
But PHPStorm inspections give me warning:
Method 'repo' not found in \GrahamCampbell\GitHub\Facades\GitHub
And phpstan throws error:
Call to an undefined static method GrahamCampbell\GitHub\Facades\GitHub::repo().
What should I do to avoid these errors?