Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: update with information about Composer >= 2.2 #141

Merged
merged 3 commits into from Jan 25, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 20 additions & 4 deletions README.md
Expand Up @@ -25,6 +25,19 @@ Installation can be done with [Composer][composer], by requiring this package as
composer require --dev dealerdirect/phpcodesniffer-composer-installer
```

When using Composer 2.2 or higher, Composer will [ask for your permission](https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution) to allow this plugin to execute code. For this plugin to be functional, permission needs to be granted.

When permission has been granted, the following snippet will automatically be added to your `composer.json` file by Composer:
```json
{
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
```

That's it.

### Compatibility
Expand Down Expand Up @@ -62,6 +75,11 @@ multiple `phpcodesniffer-standard` packages.
"object-calisthenics/phpcs-calisthenics-rules": "*",
"phpcompatibility/php-compatibility": "*",
"wp-coding-standards/wpcs": "*"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
```
Expand Down Expand Up @@ -93,7 +111,6 @@ section of the `composer.json`:
]
}
}

```

The command can then be called using `composer run-script install-codestandards` or
Expand All @@ -110,7 +127,6 @@ referenced from other script configurations, as follows:
]
}
}

```

For more details about Composer scripts, please refer to [the section on scripts
Expand Down Expand Up @@ -148,8 +164,8 @@ Create a composer package of your coding standard by adding a `composer.json` fi
"name" : "acme/phpcodesniffer-our-standards",
"description" : "Package contains all coding standards of the Acme company",
"require" : {
"php" : ">=5.4.0,<8.0.0-dev",
"squizlabs/php_codesniffer" : "^3.0"
"php" : ">=5.4.0",
"squizlabs/php_codesniffer" : "^3.6"
},
"type" : "phpcodesniffer-standard"
}
Expand Down