The resource I used for installation but wait..
To be bit a elaborate and for a proper updated installation process, here is what I did: I used the latest version of php-cs-fixer then entered the command that followed to install php-cs-fixer.
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.10.0/php-cs-fixer.phar -O php-cs-fixer chmod +x php-cs-fixer sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer sudo chown -R user name: /usr/local/bin/php-cs-fixer
sudo often require that you put password- please put your password. The part that says
username should be replaced with your linux machine's username
After that run the following command:
You should see something like the screenshot below:
Then to lint a php file, open that file with a text editor and in the terminal you can run
That will do!
By doing this, we don't always have to type the command, php-cs-fixer, in vscode terminal.
Then install php-cs-fixer vscode extension by junstyle.
Next, Open a php file that you will like to lint using vscode text editor.
On vscode, Click on settings (Linux:
ctrl + ,).
In the settings search bar, search for
php-cs-fixer executable path, you should see something like this below:
That should be it! You can lint your code now: press
ctrl + Shift + I.
That should be all.