Skip to content

Commit c921498

Browse files
authored
Update for Composer 2.2 (sirbrillig#242)
Using the `dealerdirect/phpcodesniffer-composer-installer` Composer plugin is recommended to register external PHPCS standards with PHPCS. As of Composer 2.2.0, Composer plugins need to be explicitly allowed to run. This commit: * Adds the necessary configuration for that to the `composer.json` for this project. * Adds the CLI command to set those permissions to the installation instructions for consumer projects. Includes updating the URL references to the plugin to point to the new home of the plugin. (see [upstream issue sirbrillig#146](PHPCSStandards/composer-installer#146)) Refs: * https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
1 parent 0c25aa9 commit c921498

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ VariableAnalysis requires PHP 5.4 or higher and [PHP CodeSniffer](https://github
1919

2020
This is the easiest method.
2121

22-
First, install [phpcodesniffer-composer-installer](https://github.com/DealerDirect/phpcodesniffer-composer-installer) for your project if you have not already. This will also install PHPCS.
22+
First, install [phpcodesniffer-composer-installer](https://github.com/PHPCSStandards/composer-installer) for your project if you have not already. This will also install PHPCS.
2323

2424
```
25+
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
2526
composer require --dev dealerdirect/phpcodesniffer-composer-installer
2627
```
2728

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"source": "https://github.com/sirbrillig/phpcs-variable-analysis"
2020
},
2121
"config": {
22-
"sort-order": true
22+
"sort-order": true,
23+
"allow-plugins": {
24+
"dealerdirect/phpcodesniffer-composer-installer": true
25+
}
2326
},
2427
"autoload": {
2528
"psr-4": {

0 commit comments

Comments
 (0)