diff --git a/README.md b/README.md index 3cfd6c0a..95bd1897 100644 --- a/README.md +++ b/README.md @@ -10,20 +10,6 @@ To use within your Magento 2 project you can use: composer require --dev magento/magento-coding-standard ``` -Due to security, when installed this way the Magento standard for phpcs cannot be added automatically. -You can achieve this by adding the following to your project's `composer.json`: - -```json -"scripts": { - "post-install-cmd": [ - "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)" - ], - "post-update-cmd": [ - "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)" - ] -} -``` - ### Installation for development You can install Magento Coding Standard by cloning this GitHub repo: @@ -122,7 +108,7 @@ The rules from rector that are applied are set inside the config file: `rector.p The option `--dry-run` displays errors found, but code is not automatically fixed. To run rector for `magento` projects you need to: -- Specify the magento path and the autoload file for the magento project: +- Specify the magento path and the autoload file for the magento project: ```bash vendor/bin/rector process MAGENTO_PATH --dry-run --autoload-file MAGENTO_AUTOLOAD_FILE ``` diff --git a/composer.json b/composer.json index 3668d05d..0aa931f1 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "version": "32", "require": { "php": "~8.1.0 || ~8.2.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2 || ^1.0", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", @@ -36,13 +37,9 @@ "Magento2Framework\\": "Magento2Framework/" } }, - "scripts": { - "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility/PHPCompatibility", - "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility/PHPCompatibility" - }, "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": false + "dealerdirect/phpcodesniffer-composer-installer": true } } } diff --git a/composer.lock b/composer.lock index dbe0c9be..ac79ecc1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2898da982b9bfa7d7caa896d1a5d8944", + "content-hash": "091e6e29901beb1b1791ccdc91a70f96", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer",