-
-
Notifications
You must be signed in to change notification settings - Fork 28
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 & Symfony version issue??? #338
Comments
PHPStan is installed as a phar. I assume they prefixed the phar so it shouldn't conflict with your project. Perhaps extensions are the problem? @dkarlovi what do you think? |
Ah I should have checked the PHPStan extensions - I'm using a few. On one project it seems I can get rid of the errors not by disabling the Symfony extension itself, but by removing the However, on a different project, I'm removing ALL extensions and still getting the following error:
Any thoughts? |
There's an issue with PHPStan needing to be installed directly into the project when using extensions. Sadly, currently there doesn't seem to be a way to both use extensions and use PHPStan from a Phar. Maybe @ondrejmirtes wont mind me spamming too much and just confirm / deny this. |
I recommend not using What's going on - you have multiple things installed in Path |
@ondrejmirtes in this case phpstan is installed in its own bin namespace and only shares dependencies with its plugins |
@jakzal I'm not aware of a plugin that would have |
I have a few more of these error messages that I can paste in if that would be helpful? EDIT: Although as I mentioned above, I still get one of the errors without any extensions configured at all, although they are of course still existing as part of the |
@ondrejmirtes it's the larastan plugin:
|
I went through this list: https://github.com/jakzal/toolbox/blob/master/resources/phpstan.json So the cause is probably Larastan which has a huge @benr77 I recommend you installing |
Ok, so at least the root cause is now discovered. Thank you both for that. I've been trying to remove all my coding standards packages from my projects and rely solely on phpqa as it's much easier to deal with that one install. |
I don't think there's any overhead with dealing with |
@jakzal Is it possible for me to build a customised phpqa which does not have the larastan extension? I see the instructions on how to make a custom docker build but I guess in this case I need to modify what's coming from the toolbox repo? Or would it just be a case of using the composer-bin-plugin to remove the larastan extension? |
@benr77 can you create a new issue for this use case and we'll discuss it there please? toolbox has options to support it, but I'm not sure if the docker image makes it easy 🤔 For now removing the larastan extension might be the quickest workaround. |
Using toolbox 1.39.0 and phpqa 1.49.0 on my Symfony 4.4.19 project.
At the end of every PHPStan analysis I get several errors like this.
It is complaining about a method signature mismatch between (I think!) my Symfony installation which is being analysed, and
/tools/.composer/vendor-bin/phpstan/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php
which appears to be a Symfony component as part of the PHPStan installation.I can't find any existing issues here, on phpqa or phpstan repos. Can you shed any light on this?
If it's a PHPStan issue just let me know and I'll submit an issue over there. PHPStan has switched to a PHAR format and I think this means that in its standalone form this kind of issue shouldn't happen - hence me posting here first.
Thanks for any help.
The text was updated successfully, but these errors were encountered: