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 9191 run : composer install
9292
9393 - 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:
112112npm run eslint -- path/to/analyze
113113```
114114
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+
115134## License
116135
117136Each 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 1414return static function (ContainerConfigurator $ containerConfigurator ): void {
1515 // get parameters
1616 $ 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 ' ]);
2317
2418 $ parameters ->set (Option::PHP_VERSION_FEATURES , PhpVersion::PHP_80 );
2519 $ parameters ->set (Option::PHP_VERSION_FEATURES , PhpVersion::PHP_81 );
You can’t perform that action at this time.
0 commit comments