File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 91
91
run : composer install
92
92
93
93
- name : Run rector
94
- run : vendor/bin/rector process --dry-run
94
+ run : vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autload-file vendor/squizlabs/php_codesniffer/autoload.php
Original file line number Diff line number Diff line change @@ -112,6 +112,25 @@ You can execute ESLint as follows:
112
112
npm run eslint -- path/to/analyze
113
113
```
114
114
115
+ ### RECTOR PHP
116
+ Inside ` magento-condign-standard ` project. You can execute rector php as follows:
117
+ ``` bash
118
+ vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php
119
+ ```
120
+ The rules from rector that are applied are set inside the config file: ` rector.php `
121
+
122
+ The option ` --dry-run ` allows that the errors are displayed, but the code is not automatically refactored.
123
+
124
+ To run rector for ` magento ` projects you need to:
125
+ - Specify the magento path and the autoload file for the magento project:
126
+ ``` bash
127
+ vendor/bin/rector process MAGENTO_PATH --dry-run --autoload-file MAGENTO_AUTOLOAD_FILE
128
+ ```
129
+ Example:
130
+ ``` bash
131
+ vendor/bin/rector process magento2ce/app/code/Magento/Cms/Model --dry-run --autoload-file magento2ce/vendor/autoload.php
132
+ ```
133
+
115
134
## License
116
135
117
136
Each Magento source file included in this distribution is licensed under the OSL-3.0 license.
Original file line number Diff line number Diff line change 14
14
return static function (ContainerConfigurator $ containerConfigurator ): void {
15
15
// get parameters
16
16
$ parameters = $ containerConfigurator ->parameters ();
17
- $ parameters ->set (Option::PATHS , [
18
- __DIR__ . '/Magento2 ' ,
19
- __DIR__ . '/Magento2Framework ' ,
20
- __DIR__ . '/PHP_CodeSniffer '
21
- ]);
22
- $ parameters ->set (Option::BOOTSTRAP_FILES , [__DIR__ . '/vendor/squizlabs/php_codesniffer/autoload.php ' ]);
23
17
24
18
$ parameters ->set (Option::PHP_VERSION_FEATURES , PhpVersion::PHP_80 );
25
19
$ parameters ->set (Option::PHP_VERSION_FEATURES , PhpVersion::PHP_81 );
You can’t perform that action at this time.
0 commit comments