Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates a git command 'lint-php' (if this script exists in your PATH and is executable) that syntax checks all modified/added files that end in ".php".
#!/bin/bash
files=$(git status --porcelain | sed -e 's/^.* //' | grep -P '\.php$')
for f in $files; do
php -l $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.