From 449a5b424ad3c547439aa73e51e93eee630cbb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Mon, 10 Jan 2022 11:33:39 +0100 Subject: [PATCH] Resolve #273 mark composer-runtime-api as always used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Frömer --- src/Filter/FilterCollection.php | 1 + tests/Integration/UnusedCommandTest.php | 1 + tests/assets/TestProjects/IgnoreExcludedPackages/composer.json | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Filter/FilterCollection.php b/src/Filter/FilterCollection.php index 44abae5b..7305da40 100644 --- a/src/Filter/FilterCollection.php +++ b/src/Filter/FilterCollection.php @@ -20,6 +20,7 @@ final class FilterCollection implements IteratorAggregate, Countable */ private const GLOBAL_NAMED_EXCLUSION = [ 'composer-plugin-api' => true, + 'composer-runtime-api' => true, 'composer-unused/composer-unused-plugin' => true ]; diff --git a/tests/Integration/UnusedCommandTest.php b/tests/Integration/UnusedCommandTest.php index 5ad3da05..488eea9b 100644 --- a/tests/Integration/UnusedCommandTest.php +++ b/tests/Integration/UnusedCommandTest.php @@ -82,6 +82,7 @@ public function itShouldNotReportSpecialPackages(): void self::assertSame(0, $exitCode); self::assertStringNotContainsString('composer-plugin-api', $commandTester->getDisplay()); + self::assertStringNotContainsString('composer-runtime-api', $commandTester->getDisplay()); self::assertStringContainsString('Found 0 used, 0 unused, 0 ignored and 0 zombie packages', $commandTester->getDisplay()); } diff --git a/tests/assets/TestProjects/IgnoreExcludedPackages/composer.json b/tests/assets/TestProjects/IgnoreExcludedPackages/composer.json index 233f7a0b..00606967 100644 --- a/tests/assets/TestProjects/IgnoreExcludedPackages/composer.json +++ b/tests/assets/TestProjects/IgnoreExcludedPackages/composer.json @@ -2,6 +2,7 @@ "name": "ns/lib", "require": { "dummy/test-package": "1.0", - "composer-plugin-api": "^2.0" + "composer-plugin-api": "^2.0", + "composer-runtime-api": "^2.0" } }