My Atom installation wasn’t allowing me to beautify PHP in the editor. So if you are having the same issue then don’t worry! It’s simple to install PHP-CS-Fixer on Mac High Sierra.
First we will need to run a couple of commands to download and install PHP-CS-Fixer.
You can find the lastest info in the Github repo, otherwise just follow along here.
First you will need to open terminal and download the lastest version. Just run the below command
[cc lang=”bash”]curl -L http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o php-cs-fixer
[/cc]
You will see the download begin! Once it’s finished will need to set the correct permissoions using:
[cc lang=”bash”]sudo chmod a+x php-cs-fixer[/cc]
Now let’s use the move command to move PHP-CS-Fixer into the right location.
[cc lang=”bash”]sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer[/cc]
That’s all! Now we will run PHP-CS-Fixer in the terminal to verify that it’s installed system wide.
Let’s head into Atom and beautify some PHP!
Success! apart from some small gaps. I’ll have to optimise the settings to get it perfect.