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 7fb04c15..47ebfc4d 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": "*", @@ -35,13 +36,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 9ab29109..3dc2c5bd 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": "1a1a72f8272e9cd2cb0dd520a56aeea2", + "content-hash": "5250accd9248552f2b327483e847a0cc", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer",