PHP_CodeSniffer: PHPStorm integration hangs in 3.2.0 / 3.2.1

I read that 3.2.1 was supposed to fix the issue with PHPStorm integration hanging and not producing any results. However, even after updating to the latest version, I still see this issue. When the PHPCS integration is enabled in PHPStorm, all I get are errors (from idea.log):

Note: I’m developing in Windows 7 using PHPStorm 2017.3.1

2017-12-18 11:35:24,758 [ 553921]   INFO - lity.QualityToolProcessCreator - No response from C:\Users\Riimu\AppData\Roaming\Composer\vendor\bin\phpcs.bat after 10000 ms 
2017-12-18 11:35:24,759 [ 553922]   WARN - s.quality.QualityToolAnnotator - phpcs: Can not correctly run the tool with parameters:
  C:/Users/Riimu/AppData/Local/Temp/phpcs_temp.tmp/src/ConfigureCommand.php
  --standard=PSR2
  --encoding=utf-8
  --report=xml
Possible tool process hangup after 10 sec. for 'D:/Projects/php-configure/src/ConfigureCommand.php' on local 

As with previous 3.2.0 version, doing this via command line works fine:

> phpcs src/ConfigureCommand.php --standard=PSR2 --encoding=utf-8 --report=xml
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="3.2.1">
</phpcs>

PHPCS version:

> phpcs --version
PHP_CodeSniffer version 3.2.1 (stable) by Squiz (http://www.squiz.net)

PHP Version:

> php --version
PHP 7.2.0 (cli) (built: Nov 28 2017 23:48:49) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

Will have to revert to 3.1.1 as that seems to work without issues.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@ToujouAya it might be because you use global phpcs instead of local. Double check your settings in Settings → Lang&Fw → PHP → Code Sniffer → Configuration → Local → […] → Code Sniffer (phpcs) path and make sure you’re using local vendor folder and not anything else.

I had to disable STDIN detection on Windows because I just don’t think there is any way to solve the problem. This basically reverts windows back to skipping all STDIN processing like it did in 3.1.1 but retains the new support for other environments.

Note that using - to tell PHPCS to wait for STDIN still works.

Is anyone able to confirm the fix for me by grabbing the latest master?