jakubciszak / mg-codestandards
Code styles for Magento
Requires
- php: >=5.4.0
- magento/marketplace-eqp: dev-master
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2025-03-24 19:34:03 UTC
README
This rule based on Magento Extension Quality Program Coding Standard
Installation
Composer create:
$ composer create-project jakubciszak/mg-codestandards
The scripts to set installed_paths
should be running and write the info:
Config value "installed_paths" added successfully
Basic usage
Select a standard to run with CodeSniffer:
Run CodeSniffer: Go to project directory:
$ cd mg-codestandards
$ vendor/bin/phpcs </path/to/moduleOrFile> --standard=MG1
Setting up PHPSTORM
File | Settings | Languages & Frameworks | PHP | Quality Tools
Code sniffer
-> ...
near Configuration
.
Set "PHP Code Sniffer Path" to:
/<YOURPATH>/mg-codestandards/vendor/bin/phpcs
Next go to
File | Settings | Editor | Inspections
Find PHP Code Sniffer Validation
and select Condig Standard
to MG1
Company standards
You can create your own company standards based on mg-codestandards
.
To do this, create a special_paths.cfg
file in project root directory, and add line with absolute path to your standards directory.
Eg. /home/user/rules
.
Next, run the bin/setup
script.