Skip to content

Commit

Permalink
fix mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Mar 12, 2024
1 parent e8d6200 commit 93ca74b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RequirementChecker/RequirementsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
),
);
Expand Down
5 changes: 5 additions & 0 deletions tests/RequirementChecker/RequirementsBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'),
Expand Down

0 comments on commit 93ca74b

Please sign in to comment.