Thomas Vortuba has a new tutorial posted to his site showing how to easily switch from PHP_CdeSniffer to EasyCodingStandard for enforcing the structure and syntax of your PHP application's code.
Last year, I helped Shopsys Coding Standards and LMC PHP Coding Standard to migrate from PHP_CodeSniffer to EasyCodingStandard.
There are a few simple A ? B changes, but one has to know about them or will get stuck.
Do you also use PHP_CodeSniffer and give it EasyCodingStandard a try? Today we look at how to migrate step by step.
The post then walks you through the five-step process and lists out the major changes:
- From String Codes to Autocompleted Classes
- From @codingStandardsIgnoreStart to skip Parameter
0and to skip Parameter
- From XML to YML Config Paths
- Configuring Sniff Values
- From Severity and Warning to Just Errors
- From Beautifier to --fix option
Each step includes either the command required, the configuration changes to make or code examples of the refactor to help illustrate the changes.