Skip to content

Instantly share code, notes, and snippets.

@stefgosselin
Forked from mathiasverraes/phplint.sh
Created September 28, 2017 18:04
Show Gist options
  • Save stefgosselin/12184daffa7286466411fd9872c53bb0 to your computer and use it in GitHub Desktop.
Save stefgosselin/12184daffa7286466411fd9872c53bb0 to your computer and use it in GitHub Desktop.
Recursive PHP Lint script
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`
if [ "$RESULTS" != "No syntax errors detected in $file" ]
then
echo $RESULTS
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment