Open needrunning opened 5 years ago
Yes, I've also been having this issue since the last vscode update.
I use windows system and have the same problem. Have you solved it?
I have solved it via install PHP CodeSniffe on my system
In my case, I'm getting this error because of a PHP deprecation notice that is output when phpcs --version
is run. The regex expects the output of that command to start with PHP_CodeSniffer version
, followed by the version number, but the deprecation notice is printed before that, causing the version to not be matched.
I have the same problem. php dump a warning message before any executed command and then the
.\vendor\squizlabs\php_codesniffer\bin\phpcs --version
dump this message:
PHP Warning: Version warning: Imagick was compiled against ImageMagick version 1799 but version 1802 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
Warning: Version warning: Imagick was compiled against ImageMagick version 1799 but version 1802 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
PHP_CodeSniffer version 3.5.8 (stable) by Squiz (http://www.squiz.net)
I try to change error_reporting
inside the php.ini
from E_ALL
to E_ERROR
. and then the result of
.\vendor\squizlabs\php_codesniffer\bin\phpcs --version
changed to
PHP_CodeSniffer version 3.5.8 (stable) by Squiz (http://www.squiz.net)
and my problem was resolved.
@davisben Thank you.
mac system
install phpcs via composer global require squizlabs/php_codesniffer
open vscode
installed phpcs extention
config it
exepath /Users/usernama/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs
show that
phpcs: Unable to locate phpcs. Invalid version string encountered!