Skip to content

Instantly share code, notes, and snippets.

@cakper
Created January 29, 2014 16:47
Show Gist options
  • Save cakper/8692003 to your computer and use it in GitHub Desktop.
Save cakper/8692003 to your computer and use it in GitHub Desktop.
PHPSpec & PHPCsFixer pre commit hook
#!/bin/sh
if [ -f ./bin/phpspec ]
then
./bin/phpspec run --quiet
if [ $? -ne 0 ]
then
echo "PHPSpec has failed - commit aborted"
return 1
fi
fi
if [ -f ./bin/php-cs-fixer ]
then
./bin/php-cs-fixer fix --quiet --dry-run src
if [ $? -ne 0 ]
then
echo "PHPCS has failed - commit aborted"
return 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment