valeryan / vscode-phpsab

Php Sniffer and Beautifier for VS Code
https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab
MIT License
58 stars 12 forks source link

Returns Error with Invalid JSON #146

Open mrkdevelopment opened 1 month ago

mrkdevelopment commented 1 month ago

As of yesterday I was getting an invalid response on all PHPCS calls. This said it had invalid json.

I checked phpcs - ran commands using the --json format and they worked everytime.

I had to switch to a different tool for now.

Now sure what else you need to make this useful.

PHPCS using php 8.3

command line was working

Using brew on macos for php handling and phpcs.

jonathanbossenger commented 1 month ago

@mrkdevelopment does your path to either your workspace or the phpcs executable contain spaces?

gdebrion commented 3 weeks ago

@jonathanbossenger Hello Jonathan, I have the same problem and I have spaces in my directory folder. The command seems to be the following one:

["INFO" - 10:01:55] SNIFFER COMMAND: /home/gdebrion/.composer/vendor/bin/phpcs --report=json -q --standard=PSR12 --stdin-path=/home/gdebrion/www/My Project/planning/trunk/app/Http/Controllers/ClockController.php -
["ERROR" - 10:01:55] ERROR: The file "Project/planning/trunk/app/Http/Controllers/ClockController.php" does not exist.

I guess adding quotes to stdin-path can resolve this issue…

danieliser commented 1 week ago

Yes path has spaces, but other than changing the path, how can we fix this? The path has always had spaces, and suddenly this has become an issue. Don't remember this issue before.