Last active
June 8, 2023 20:54
-
-
Save kraken-chris/d2fbf369616284d403cb698511d49f76 to your computer and use it in GitHub Desktop.
Setup Magento PHP_Codesniffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Use the latest PHP_Codesniffer version | |
composer require squizlabs/php_codesniffer:^3.5 --dev | |
## Use the latest versino of Magento Coding Standard | |
composer require magento/magento-coding-standard:^28 --dev -W | |
## Make sure phpcs works | |
vendor/bin/phpcs -i | |
## Add Magento 2 Coding Standard to PHP_Codesniffer | |
vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/ | |
## PHP_CS should now show "Magento2Framework" | |
vendor/bin/phpcs -i | |
## Example usage: | |
vendor/bin/phpcs --standard=Magento2Framework app/code/Kraken/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment