Ok, I'll take a look at that!
... I wonder if there's a rule for php -l too, as a pre-commit check. They use this at work with GitLab to prevent commits containing syntax error(s).
I'll see what other capabilities may be available.
I have a whole range of git hooks that I can let you have, including one that checks for syntax errors. It is late here now, but I can let you have them in the morning (UK time).