Checking your code for PSR-2
Most of the projects that I work on follow the PSR-2 coding style guidelines. I prefer to ensure that my PRs pass before Travis or Jenkins tells me, so let's look at how to run PSR-2 checks locally. PHP_CodeSniffer My preferred tool for checking coding styles in PHP is PHP_CodeSniffer. This is command line tool, phpcs, that you can run against any file. PHP_CodeSniffer can test against a number of standards. The default is PEAR,… continue reading.