Skip to content

Instantly share code, notes, and snippets.

@mcfdn
Last active December 22, 2016 10:59
Show Gist options
  • Save mcfdn/f401254c5ffccb05bb2f07108d9b785c to your computer and use it in GitHub Desktop.
Save mcfdn/f401254c5ffccb05bb2f07108d9b785c to your computer and use it in GitHub Desktop.
Recursive PHP linter
#!/bin/bash
EXITCODE=0
if [[ -z $1 ]]
then
FILES=app
else
FILES=$1
fi
for f in $(find $FILES -name '*.php')
do
php -l $f
if [ $? -ne 0 ]
then
EXITCODE=1
fi
done
exit $EXITCODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment