0

I use PhpStorm 2021.3 on MacOS (Apple Sillicon M1). I'm not sure the problem is with PhpStorm but PHP Code Sniffer doesn't work.

When I type this command it doesn't show any errors in the code and I'm sure I got some.

vendor/bin/phpcs

The only thing that appears in the console is Time: 38ms; Memory: 8MB

CodeSniffer is installed by composer.

On the other hand, if I enter this same command in Docker (with Laravel Sail, in bash), I do get a list of errors/warnings in my code.

Going back to PhpStorm, I tried to configure the IDE to work with PHPCS in Docker, but it still doesn't work, and I don't know where to look.

PHP_CodeSniffer version 3.6.2 (stable) by Squiz

How to make CodeSniffer work, either through PhpStorm or automate it in PhpStorm and Docker?

pirmax
  • 2,054
  • 8
  • 36
  • 69
  • If you run the command in the local system terminal, not in PhpStorm, does it yield results? – Eugene Morozov Mar 25 '22 at 13:49
  • @EugeneMorozov Nothing to display too when I'm in PhpStorm / PhpStorm Console / Terminal – pirmax Mar 25 '22 at 14:03
  • To be sure, does it validate correctly in "PHP | Quality Tools"? Assuming that you have the inspection (Editor | Inspections | PHP | Code Quality) enabled, I would suggest to also enable the extended PHP actions logging and check what exact command is being executed by PhpStorm and what output it gets -- this information should be added to the IDE log file. To enable the extended logging you need to add the following line to the "Help > Diagnostic Tools > Debug Log Settings" section: #com.jetbrains.php Afterwards, you may find log with the "Help > Show log in Finder". – duck_in_hat Apr 07 '22 at 04:15

0 Answers0