ikappas / vscode-phpcs

PHP CodeSniffer for Visual Studio Code
MIT License
128 stars 56 forks source link

phpcs: Unknown error ocurred. Please verify that .... returns a valid json object. #193

Closed FranciscoCaldeira closed 2 years ago

FranciscoCaldeira commented 2 years ago

phpcs: Unknown error ocurred. Please verify that C:\Users\francisco.caldeira\AppData\Roaming\Composer\vendor\bin\phpcs.bat --report=json -q -s --encoding=UTF-8 --standard=PSR12 --ignore=database/* --error-severity=5 --warning-severity=5 --stdin-path=$\Ubuntu-20.04\home\francisco_caldeira\Repositorio\ContractsAPI\app\Models\Userl.php - returns a valid json object.

I have docker and installed composer global and done apt install php-codesniffer, still the phpcs.executablePath keeps failing even reset. I've reinstalled the extension multiple times. I use VS code 1.62.2. php -i ->PHP 7.4.9 (cli) (built: Aug 6 2020 19:13:01) ( NTS ) phpcs -i -> The installed coding standards are PSR2, PEAR, PSR12, MySource, Squiz, Zend and PSR1 phpcs --version ->PHP_CodeSniffer version 3.6.1 (stable) by Squiz (http://www.squiz.net) which phpcs -> /usr/local/bin/phpcs

FranciscoCaldeira commented 2 years ago

My problem was that my VS code window wasn't with "open a remote window" to my WSL:Ubundo20.04

img