Before I commit changes to my PHP / Symfony projects, I like to pre-check it against a few utilities to ensure quality and consistency. This little script to automates the steps:
- A PHP compilation check.
- A syntax cleanup - PHP Coding Standards Fixer
- Run my unit tests - PHPUnit - with code coverage as an option.
- Then optionally commit and push changes - only if the above steps passed.
It’s simple and I can modify it easily from one project to another. I thought I’d both share it and ask for any tips on improvements.
Here it is: check.sh
You can run it via something like:
./check.sh -g -b -p -m "Fixed the stuff and things."