From 270c7c3262b928835b78c2c809cb51aaabfe4fed Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Tue, 28 Apr 2020 16:04:00 +0200 Subject: [PATCH] Backport validation support for composer-runtime-api (#8842) Fixes #8841 --- src/Composer/Repository/PlatformRepository.php | 2 +- .../Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 265cdbf4a..1426d4a16 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -27,7 +27,7 @@ use Symfony\Component\Process\ExecutableFinder; */ class PlatformRepository extends ArrayRepository { - const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer-plugin-api)$}iD'; + const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer-(?:plugin|runtime)-api)$}iD'; private $versionParser; diff --git a/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php b/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php index 9dabb23b7..e1ce9264a 100644 --- a/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php @@ -86,6 +86,7 @@ class ValidatingArrayLoaderTest extends TestCase 'a/b' => '1.*', 'b/c' => '~2', 'example' => '>2.0-dev,<2.4-dev', + 'composer-runtime-api' => '*', ), 'require-dev' => array( 'a/b' => '1.*',