-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
phpstan 1.3 crashes for some reason #6300
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
I use larastan extension cc @nunomaduro Final trace
|
This is probably an infinite recursion problem. Running with XDebug (don't forget to add --xdebug when running PHPStan too) might show us the stack trace where it keeps repeating. |
|
Looks like something related to |
./vendor/bin/phpstan analyse --memory-limit=2G --debug -vvv --xdebug /var/www/app/Transformers/AddressTransformer.php It will also do that on the <?php
namespace App\Transformers;
use Illuminate\Support\Facades\Redis;
class AddressTransformer
{
public function getPostalCodeAndCity($lat, $lng)
{
$redisKey = 'foo';
if (empty(Redis::get($redisKey))) {
Redis::set($redisKey, $res);
} else {
return Redis::get($redisKey);
}
}
} It seems to be linked to the Redis interface: https://github.com/laravel/framework/blob/8.x/src/Illuminate/Support/Facades/Redis.php |
In hindsight it's obvious this needed to be handled. Fixed: phpstan/phpstan-src@9ab4e6f Please test dev-master of phpstan/phpstan once the PHAR is built. Thanks! |
Thank you for the quick fix ! It did result in new errors
That said they are not undefined, not sure if this is a phpstan or larastan error to handle |
Yeah, I expected that. If you look at the fix and the test, it's gonna make sense to you. Class A says method foo() is on class B. Class B says method foo() is on class A. So the right answer here is actually that the method does not exist. Of course I don't know what's the reason behind this problem in Larastan/Laravel, I haven't looked into that. I'm just preventing the crash with my fix. |
Oh okay, as you can see on https://laravel.com/docs/8.x/redis#interacting-with-redis it is valid and should work cc @nunomaduro |
Just open an issue on Larastan repo :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
phpstan 1.3 crashes, 1.2 works fine
this is NOT a memory limit error
Code snippet that reproduces the problem
No idea of what it is, on my workstation and on @Guileas's workstation it crashes too
On the CI it fails differently
Traces
On workstations
On CIs
Expected output
Work as always
Did PHPStan help you today? Did it make you happy in any way?
Yes !!!!
The text was updated successfully, but these errors were encountered: