PHP Architect · Vol 16, Issue 12 · December 2017
Education Station: How to Write Your Own Code Sniffer
by Matthew Setter
Whether you’re new to PHP, or you’re more of a seasoned veteran, you’ve probably heard about PHP_CodeSniffer. The package, which has been around since September 2006, checks source code for coding standards violations. I’ll start off by showing you how to create a style which is a combination of other standards. I’ll then refactor it, so you learn how to pick and choose only the elements from those standards you need. Finally, I’ll step through the process of creating your own code sniff from scratch, one handling a specific use case.
The full article is in PHP Architect Vol 16, Issue 12. Subscribe to read it and every new issue.