fterrag/vscode-php-cs-fixer

Support for PHP 8.0

Opened this issue · 6 comments

Extention throws the following error when using PHP 8.0:

Command failed: php /home/user/.vscode-server/extensions/fterrag.vscode-php-cs-fixer-0.4.0/php-cs-fixer fix --using-cache=no --rules=@PSR1,@PSR2,@Symfony,-yoda_style /tmp/tmp-6429kH5SGWj6FDc7
PHP needs to be a minimum version of PHP 5.6.0 and maximum version of PHP 7.4.*.

Is there a fix for this. If my default PHP is 8 the extension is broken

@vbasky The workaround I've found is to not have PHP 8.0 on my machine, since its what it is used by vscode to run extentions, then use PHP 8.0 on my containers to have PHP8 on my application.

Thanks but I have php locally on my machine for valet and few other things. Using the toolPath I could point it to the php 8 installation on the machine but since VSCode is synced across both my Windows and Mac the paths are incompatible.

it seems that the newest version of php-cs-fixer is compatible with 8.0
https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/tag/v3.4.0

but I tried replacing it in the extension and it still fails with no further error..

any ideas?

@mathiasHillmann I could not get you extension to work, unfortunately.

my fix was to replace the php-cs-fixer with a newer version (as for now it's 3.4)
and generate a new config file using this tool:
https://mlocati.github.io/php-cs-fixer-configurator/#version:3.4|configurator

@fterrag if you accept prs I might send you one to update this

cheers, dan