When I open my project, I get a toast message about PHP_CodeSniffer not being able to find input file. I'm unable to figure out the exact settings I need to use.
My project root has a phpcs.xml file with our coding standard, that's consumed by some GitLab pipeline. The application runs inside a Docker container and all the code is in a volume. Potentially, I have three ways to run phpcs:
- Preferred option would be a dedicated phpcs container. In a terminal, I can do this just fine:
docker run -it -v "$(pwd)":/code registry.gitlab.com/pipeline-components/php-codesniffer:latest phpcs --report=full
- I also have a local PHP interpreter in host machine (Kubuntu) with a global PHP_CodeSniffer installation. In a terminal:
- And PHP_CodeSniffer is also available inside the application container, as DEV dependency for some third-party package, although we'll probably remove it at some point:
docker exec -it app-container-name vendor/bin/phpcs --report=full
Edit: this one doesn't actually work, it targets an invalid PHP version.
I'm lost in PHP_CodeSniffer settings dialogue. There's a side pane with three interpreters (two of them come from the CLI Interpreters section, where I've defined my app container and my local binary; the other one is called "System PHP" and I don't know where it comes from), I've been trying several combinations and I never make it work. I can't even understand how to let PhpStorm know which of the interpreters to use.