I am trying to figure out which code style to enforce with the phpcs
code sniffer.
Since the popularity of Symfony2, it seems to be a good practice to use its code standard. On the other hand, its code style is based upon PSR2, so this seems to be the most basic style one should use.
Furthermore, in the basic installation of squizlabs/php_codesniffer
, the Symfony2 standard is not included and has to be manually installed whereas the PSR2 is easily available.
So I want to know the the main difference of the Symfony2 guideline as compared to the PSR2 in order to decide which to use.
For instance, I realized that Symfony2 style enforces that Concat operator must not be surrounded by spaces
while the PSR2 ignores this case. Yet I did not find an easy way to list the differences. I looked in the rulseset.xml
but it was not that clear to me how it is set up.
I am interested in how to get a complete lists of the differences between the PSR2 and Symfony2 code standard.