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
New symfony 6.1 projects can't be inspected using docker image as they rely on PHP 8.1 #7334
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
I'd say the Docker image is really needed only in some special scenarios. You can run PHPStan in the same environment you run your app, be it your Docker image or directly on your host computer. |
Yes, although technically you can run it on your host computer, if there are multiple developers on the project, it's important to ensure that all of them have the same setup and environment, lest you start to encounter issues of 'well, it works on my machine'. Plus it's a lot easier to tell new developers to install docker, and then everything else will work as per documented in the project, [and then have a docker command in the projects docker-compose.yml] rather than to make them set up all tools and inspections with different profiles in their host machine. For that, a docker is very useful. For instance, we have 6 different apps running solely in a single project. PHPStan inspections passing is one of the requirements we set out to impose on the developers before creating a PR. For these reasons, I feel that using the docker image is the ideal way for our needs. |
I can't change the base image of the currently used tags for backward compatibility reasons, but I introduced new tags that use PHP 8.1. See release notes: https://github.com/phpstan/phpstan/releases/tag/1.7.3 |
And that's why you should have your own Docker setup in the project, for running it locally within common runtime across all developers' computers. But it should be your app's runtime, not basic PHPStan Docker image 🙂 Same image could be built in CI/CD pipeline and all checks could be run on it. It's even more consistent then 😉 But anyway, great to see @ondrejmirtes offering image and now it's even better 😁 |
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
I've got a project that uses Symfony (a very basic Symfony API used for mocking external services in a local project.
Ever since the 6.1 Symfony release, PHPStan [latest docker image] fails to run for the project.
My theory at the time - seeing that Symfony requires PHP versions have been bumped to 8.1 that this is a language version-specific issue.
To verify this I've cloned a repository, changed the base image to 8.1, and used the newly built image for the same inspection - which worked fine.
I assume We're happy about just bumping the base image to 8.1?
See the following stack trace:
The text was updated successfully, but these errors were encountered: