Skip to content

Instantly share code, notes, and snippets.

@vedit
Created June 10, 2020 13:58
Show Gist options
  • Save vedit/3e0df2de8201f73cbea2ebd441403eae to your computer and use it in GitHub Desktop.
Save vedit/3e0df2de8201f73cbea2ebd441403eae to your computer and use it in GitHub Desktop.
PHP Syntax Checker Script
#!/bin/bash
docker run -t -v "$PWD":/usr/src/ci -w /usr/src/ci php:7.2-cli bash -ec "find . -path ./vendor -prune -o -type f -iname '*.php' | xargs -I{} sh -c 'php -l {} || true'" | grep 'Parse error' && exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment