At work, we used a SVN server and enforced our project coding standard with a pre-commit hook on the server that ran PHP_CodeSniffer.
Whenever a developer tried to commit some code that does not match the standard, he got it rejected.
To be able to check in legacy code, our commit hook recognized special commit message tags like "SKIP_CS".
Developers using that were logged and beaten at the end of the week when they used it too often :)
