remove trailing space before newlines
whitespace fixes per phpcs
re-capitalize IFs in SQL
Merge pull request #234 from paulschreiber/phpcs-fixes

PHPCS whitespace fixes