diff --git a/src/RequirementChecker/RequirementsBuilder.php b/src/RequirementChecker/RequirementsBuilder.php index 1cf8a9339..d8a5b4a2d 100644 --- a/src/RequirementChecker/RequirementsBuilder.php +++ b/src/RequirementChecker/RequirementsBuilder.php @@ -138,7 +138,7 @@ static function (array $sources): array { usort( $sources, static fn (array $sourceTypePairA, array $sourceTypePairB) => strcmp( - (string) $sourceTypePairA[0], + $sourceTypePairA[0], (string) $sourceTypePairB[0], ), ); diff --git a/tests/RequirementChecker/RequirementsBuilderTest.php b/tests/RequirementChecker/RequirementsBuilderTest.php index 7331cea88..f98cad507 100644 --- a/tests/RequirementChecker/RequirementsBuilderTest.php +++ b/tests/RequirementChecker/RequirementsBuilderTest.php @@ -68,6 +68,10 @@ public function test_it_can_build_requirements_from_required_extensions(): void new Extension('http'), 'package2', ); + $this->builder->addRequiredExtension( + new Extension('http'), + null, + ); $this->builder->addRequiredExtension( new Extension('phar'), 'package1', @@ -83,6 +87,7 @@ public function test_it_can_build_requirements_from_required_extensions(): void ); $expected = new Requirements([ + Requirement::forRequiredExtension('http', null), Requirement::forRequiredExtension('http', 'package1'), Requirement::forRequiredExtension('http', 'package2'), Requirement::forRequiredExtension('openssl', 'package3'),