The PEAR standard is the most basic and standard from which most others evolved. This has been a long time, but has not been updated for quite some time. It was originally used by PEAR packages (e.g. PHP_CodeSniffer), and I think this is a good standard for beginners.
The PEAR standard contains 26 main checks.
The PSR2 standard is relatively new and was developed by PHP-FIG. It takes many forms in many forms. I think this is the standard for choice if you want to stick to one, and you really don't know what to choose.
The PSR2 standard contains 40 main checks.
The Squiz standard is the one I use at work. I developed PHP_CodeSniffer, so itβs not surprising that the standard I use is very strict. It also contains checks for JS and CSS files, as they are used in our large web applications. This is definitely not the standard for beginners, and it changes regularly. But it contains a lot of good checks that can be included in a custom coding standard.
The Squiz standard contains 124 main checks.
So, my suggestion for you is to try the PSR2 standard and see how you go. If you start to feel that this does not work for you in small ways, you can take a look at creating your own ruleset.xml file to create your own custom encoding standard. There are docs for this process here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
Greg sherwood
source share