Skip to content

Instantly share code, notes, and snippets.

@lillesvin
lillesvin / git-lint-php
Created August 28, 2015 08:45
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