Skip to content

Commit

Permalink
Deprecate plugin's own ignore feature
Browse files Browse the repository at this point in the history
in favor of Composer's own audit ignore feature
  • Loading branch information
mxr576 committed Mar 14, 2024
1 parent 7f28926 commit 6ec038d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ comes with minimal opt-out options.
### Silence warning about a deprecated- or unsupported package version in use

> [!WARNING]
> For Composer < 2.6.0 only. This feature will be removed when the minimum required Composer version gets bumped to >=2.6.0.
> This feature is **deprecated** and it is going to be removed in version 2.0.0. Composer's built-in [audit ignore](https://getcomposer.org/doc/06-config.md#ignore) feature replaced it.
In a project's root composer.json, under the `extra` property, add a definition like this:

Expand Down
3 changes: 3 additions & 0 deletions src/Domain/PackageIgnore/PackageIgnoreRuleOptimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ final protected function optimizePackageIgnoreRules(PackageIgnoreRuleProvider $p
$rules = $provider->getIgnoreRules();
/** @var \mxr576\ddqgComposerAudit\Domain\PackageIgnore\PackageIgnoreRule[] $rules */
$rules = $rules instanceof \Traversable ? iterator_to_array($rules, false) : $rules;
if ([] !== $rules) {
trigger_error("Since 1.1.0 DDQG Composer Audit plugin's ignore features are deprecated, use Composer's built-in audit ignore feature instead. https://getcomposer.org/doc/06-config.md#ignore", E_USER_DEPRECATED);
}
/** @var \ArrayObject<string,array<\mxr576\ddqgComposerAudit\Domain\PackageIgnore\PackageIgnoreRule>> $tmp */
$tmp = array_reduce($rules,
static function (\ArrayObject $carry, PackageIgnoreRule $item) {
Expand Down

0 comments on commit 6ec038d

Please sign in to comment.