-
Notifications
You must be signed in to change notification settings - Fork 30
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
Upgrading to 0.7 breaks PHPStan #179
Comments
Confirmed here too |
The stubs here are really simple, not sure what causes this. I'm gonna investigate. |
Unfortunately I'm not able to reproduce this. It runs fine. Running |
This doesn't help me reproduce it. I need some minimal code on which it crashes like this. Thanks. |
@ondrejmirtes I liked the issue in our repo for you to look. You can easily clone that branch to reproduce. |
@ondrejmirtes i haven't tracked this down yet but i'm getting there. the phpstan container is being build incorrectly?
|
got it. This repo contains https://github.com/Jan0707/phpstan-prophecy/blob/master/extension.neon and then a symlink https://github.com/Jan0707/phpstan-prophecy/blob/master/src/extension.neon for BC with 0.6.2. If you load the symlink, i.e.
the relative path resolution to the stubs doesn't work. Either phpstan could resolve symlinks or...?? |
If you’re running phpstan-src and not phpstan/phpstan distribution then nothing is guaranteed to work (phpstan-src is just for PHPStan development itself) but I still don’t see how this could break. |
It’d be great if someone created a small reproducing repo (with phpstan/phpstan as Composer dependency) so I can debug it. |
@ondrejmirtes did you see my comment? |
I will remove the symbolic link in the next release, if that helps! |
That, or this line: needs changing to $dir = dirname(realpath($file)); |
@bendavies @flangofas @ondrejmirtes I have removed the symbolic link in #182. This will break installations for people who do not use
Not sure if there are other projects using symbolic links, but I believe we are good in regard to this project now, what do you think? |
@localheinz Thank you, symbolic links are generally problematic, IIRC they don't translate well on Windows. (I've wanted the People are encouraged to use extension-installer but they can't always do that. For example if they only want to use some of the rules from phpstan-strict-rules, they can't use extension-installer. Since the package is just a convenient way to save a few lines from the configuration file, it's fine. Anyway, 👍 on the fix, using symlinks in this context is discouraged. |
@bendavies Sorry, haven't seen your comment before replying. |
Thank you, @ondrejmirtes! |
Fixed with #182. |
thanks all |
thanks for your prompt answers and the quick fix. |
You are welcome, @bendavies and @flangofas! |
Hey guys,
The following setup breaks PHPStan while the previous release (0.6.2) worked just fine.
PHP: 7.4
PHPStan: 0.12.23
PHPStan-Prophecy: 0.7
Relates to: slimphp/Slim-Skeleton#163
Expected:
[OK] No errors
Output:
In StubPhpDocProvider.php line 150:
[PHPStan\ShouldNotHappenException]
Internal error.
Exception trace:
The text was updated successfully, but these errors were encountered: