-
-
Save thoroc/170b08fcc653b6086fed to your computer and use it in GitHub Desktop.
Fix PHP Coding Style for Symfony2 project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# we are assuming php-cs-fixer installation path | |
BIN=/usr/local/bin/php-cs-fixer | |
# install php-cs-fixer | |
if [ ! -f $bin ]; then | |
echo "Preparing to install php-cs-fixer ..." | |
wget http://cs.sensiolabs.org/get/php-cs-fixer.phar -O $bin | |
chmod a+x $bin | |
echo "php-cs-fixer has been successfully installed." | |
fi | |
# using git to get the path to the project | |
BASE_PATH=$(git rev-parse --show-toplevel) | |
if [ $? != 0 ]; then | |
echo "run this at the root of the project" | |
exit 1; | |
fi | |
php-cs-fixer fix $BASE_PATH/src --fixers=@symfony,align_double_arrow,align_equals,ordered_use,short_array_syntax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment