Add PHP_CodeSniffer and PHP syntax check to Travis; add pre-commit hook

For #557.