Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with PHP Code Sniffer and PhpStorm

Tags:

phpstorm

phpcs

17:18   PHP Code Sniffer
        No response from /home/my_user/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs after 5000 ms
        Disable inspection

Any idea? I've tried a lot of solutions like disable xdebug, increment response time.

It does not work in PhpStorm but works in the terminal.

like image 904
Juan Wilde Avatar asked Oct 22 '25 19:10

Juan Wilde


1 Answers

I looked into this problem today and it is caused by a change to the STDIN processing code for PHPCS 3.2.0. I don't know exactly why it looks like STDIN has content but nothing is coming through, but that's what PHPCS sees and so it waits forever. PHPStorm times out after 5 seconds (I think it is, by default).

I've pushed up a change to PHPCS to enforce a short time-out on STDIN and tested this change with PHPStorm, which is now working for me.

If you can use the current master branch for PHPCS, it should work ok. If not, reverting back to 3.1.1 (or earlier) is all you can do until 3.2.1 is released. I'm not sure when that will be just yet.

like image 89
Greg Sherwood Avatar answered Oct 25 '25 09:10

Greg Sherwood