Tags:

Available Magento Code Sniffer rulesets

Basically I recommend following the PSR-2 standard for Coding Style Guidelines in Magento projects. Verifying your coding styles makes sense in any case – whether you are working in a large team of developers or as a freelancer for several clients. Agreeing to one common coding standard and following the rules improves readability and comparability.

Chris / / last updated on

Basically I recommend following the PSR-2 standard for Coding Style Guidelines in Magento projects. Verifying your coding styles makes sense in any case – whether you are working in a large team of developers or as a freelancer for several clients. Agreeing to one common coding standard and following the rules improves readability and comparability.

But as we all know Magento has some quirks that do not fit very well this standard (like underscore class names, underscore prefixed variables, etc.)

That’s why some people adapted the existing rulesets to Magento.

This is a short list of customized Magento Code Sniffs for phpcs:

Update:
An interesting discussion regarding the ECG Coding Standard can also be found on StackExchange.

Which coding standards do you use?

BTW: Here is a useful tutorial how the phpcs tool can e.g. easily be integrated into PHPStorm.


Post Comments to "Available Magento Code Sniffer rulesets"

Submit Comment

With the use of this comment form you agree to the saving and processing of your data by this website. More information about the processing of your data can be found in our privacy statement.
Your data will be transmitted securely via SSL.

Meine Magento Extension Bestseller