fterrag / vscode-php-cs-fixer

Support for php-cs-fixer in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=fterrag.vscode-php-cs-fixer
MIT License
11 stars 7 forks source link

Support for PHP 8.0 #15

Open ghost opened 3 years ago

ghost commented 3 years ago

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.*.
vbasky commented 3 years ago

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

ghost commented 3 years ago

@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.

vbasky commented 3 years ago

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.

danielzzz commented 2 years ago

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 commented 2 years ago

I have created an extension that supports 8.0

https://marketplace.visualstudio.com/items?itemName=mhillmann.php-ide

danielzzz commented 2 years ago

@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