Download php-cs-fixer https://github.com/FriendsOfPHP/PHP-CS-Fixer in the Cloud9 workspace:
$ wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.0.0/php-cs-fixer.phar -O ~/php-cs-fixer
Put it in the ~/bin :
$ mkdir ~/bin; mv ~/php-cs-fixer ~/bin
Make an executable file:
$ chmod a+x ~/bin/php-cs-fixer
Configure your Formatter parameter for the IDE for PHP to use the formater with any rules you want :
php-cs-fixer fix "$file" --rules=@Symfony ,@PSR2
What my ~/workspace/.c9/project.settings file looks like:
... "php": { "@completion": true, "@formatOnSave": true, "@formatter": "php-cs-fixer fix \"$file\" --rules=@Symfony ,@PSR2", "@path": ".:./vendor:/usr/local/bin" }, ...
source share