File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
A set of Magento rules for [ PHP_CodeSniffer] ( https://github.com/squizlabs/PHP_CodeSniffer ) tool.
4
4
5
- ### Installation
6
- For development puposes you can install Magento Coding Standard by cloning this GitHub repo
5
+ #### Installation within a Magento 2 site
6
+ To use within your Magento 2 project you can use:
7
+ ````
8
+ composer require --dev magento/magento-coding-standard
9
+ ````
10
+ Due to security, when installed this way the Magento standard for phpcs cannot be added automatically.
11
+ You can achieve this by adding the following to your project's ` composer.json ` :
12
+ ````
13
+ "scripts": {
14
+ "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/",
15
+ "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/"
16
+ }
17
+ ````
18
+
19
+ ### Installation for development
20
+ You can install Magento Coding Standard by cloning this GitHub repo
7
21
```
8
22
$ git clone [email protected] :magento/magento-coding-standard.git
9
23
$ cd magento-coding-standard
@@ -13,7 +27,6 @@ It is possible also to install a standalone application via [Composer](https://g
13
27
```
14
28
$ composer create-project magento/magento-coding-standard --stability=dev magento-coding-standard
15
29
```
16
- Or require ` magento/magento-coding-standard ` inside your project using ` composer require ` command.
17
30
18
31
#### Verify installation
19
32
Command should return the list of installed coding standards including Magento.
Original file line number Diff line number Diff line change 14
14
"phpunit/phpunit" : " ^4.0 || ^5.0 || ^6.0 || ^7.0"
15
15
},
16
16
"scripts" : {
17
- "post-install-cmd" : " vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../ .." ,
18
- "post-update-cmd" : " vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/,../../ .."
17
+ "post-install-cmd" : " vendor/bin/phpcs --config-set installed_paths ../../.." ,
18
+ "post-update-cmd" : " vendor/bin/phpcs --config-set installed_paths ../../.."
19
19
}
20
20
}
You can’t perform that action at this time.
0 commit comments