March 10, 2015

PHP / Symfony Checker

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:

  1. A PHP compilation check.
  2. A syntax cleanup - PHP Coding Standards Fixer
  3. Run my unit tests - PHPUnit - with code coverage as an option.
  4. 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.

PHP Symfony Checker

Here it is:

You can run it via something like:

./ -g -b -p -m "Fixed the stuff and things."