Skip to content

Instantly share code, notes, and snippets.

@cirops
Forked from krolow/qa.sh
Created December 10, 2012 14:16
Show Gist options
  • Save cirops/4250796 to your computer and use it in GitHub Desktop.
Save cirops/4250796 to your computer and use it in GitHub Desktop.
Quality Assurance PHP (checks if the programs exist in the system)
#!/bin/bash
PROGRAMS=(phpmd php-cs-fixer phpcpd phploc)
for PROGRAM in ${PROGRAMS[*]};
do
command -v $PROGRAM >/dev/null 2>&1 || { echo "I require $PROGRAM but it's not installed. Aborting." >&2; exit 1; }
done
echo "======================================================================================="
echo "Fixing code standard"
echo "======================================================================================="
php-cs-fixer fix $PWD/src/
echo "Ok done ;)"
echo ""
echo "======================================================================================="
echo "Lets see the mess in our code"
echo "======================================================================================="
phpmd $PWD/src/ text codesize,unusedcode,naming,design,controversial
echo ""
echo "======================================================================================="
echo "Lets see if you like ctrl + c and ctrl + v"
echo "======================================================================================="
phpcpd $PWD/src/
echo ""
echo "======================================================================================="
echo "What about your code? code says about everything let's see..."
echo "======================================================================================="
phploc $PWD/src/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment