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
Syntax error reported when there are none (only in CI/Jenkins, phpVersion 80000) #3943
Comments
On PHP 8 classes can no longer be named “Match” so you have that somewhere in your code or dependencies. |
I couldn't find that word "match" in the class having the error. But as you mentioned dependencies, I'll have to look through the whole code base (on my way home now, can't do it on mobile). Is it only classes, or methods/functions too ? Any idea why it works locally and not on the CI server ? Should there be a PhpStan inspection for that (so it could help tracking down the source of the issue) ? |
Function too: https://3v4l.org/FfjjA PHPStan currently doesn't know which file caused the parse error, I'll do some refactoring so that it can be reported too. |
I found it : willdurand/Negotiation#106 |
Glad you sorted it out :) I'm gonna improve the message, thanks. |
Weird... I still have the error on the CI even after upgrading the library. :/ And I can't find any other |
Alright, now you have the chance to see the real file with the parse error: phpstan/phpstan-src@8113f38 The output now looks something like this:
|
Awesome, I'll give it a try next Friday ! Thanks :D |
OK, so PhpStan gave me the clue I needed indeed :
(though it's a bit weird that the error line is reported many times) However, I'm not sure how to fix it... I'm stuck on PHP 7.2 for some more months, so I can't upgrade to the new version of PHPUnit and I can't get rid of it in the CI environment. This would not happen in production as it's a dev dependency. @ondrejmirtes Any way to ignore this error ? (and I'm still not clear why this error is not reported in the local environment where PHPUnit is installed too!) I tried installing Symfony phpunit bridge instead of requiring it in our vendors directly, but the test suite breaks and I'm not sure I'll find a way to fix it. |
You're not supposed to run with |
Oh.. that explains it all! 🙈 Still that leaves open the question why the PHPUnit Match class did not appear when running PhpStan locally with 80000, but appeared on the CI... |
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. |
Hello there,
I just upgraded to 0.12.49 and started using phpVersion 80000 on our project. I fixed all inspections locally, then deployed on our Jenkins CI. It then reported the following errors on various classes :
There is no syntax error in none of the files (the code is running in production on PHP 7.2 fine) and we use phplint to validate the code base. I can't find something that would be broken in PHP8, but maybe there is ? Any clue what that might come from ? (sorry, I cannot share the whole code...)
The text was updated successfully, but these errors were encountered: