Skip to content

Commit 5e51460

Browse files
committed
Fix new static analysis issue with minimumStability constants
1 parent f399ea2 commit 5e51460

File tree

3 files changed

+34
-28
lines changed

3 files changed

+34
-28
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- '8.1'
1919
- '8.2'
2020
- '8.3'
21+
- '8.4'
2122
steps:
2223
- name: Setup PHP
2324
uses: shivammathur/setup-php@v2

composer.lock

Lines changed: 27 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DependencyResolver/ResolveDependencyWithComposer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
namespace Php\Pie\DependencyResolver;
66

77
use Composer\Composer;
8+
use Composer\Package\BasePackage;
89
use Composer\Package\CompletePackageInterface;
910
use Composer\Package\Version\VersionSelector;
1011
use Composer\Repository\CompositeRepository;
1112
use Composer\Repository\RepositorySet;
1213
use Php\Pie\ExtensionType;
1314
use Php\Pie\Platform\TargetPhp\ResolveTargetPhpToPlatformRepository;
1415
use Php\Pie\Platform\TargetPlatform;
16+
use Webmozart\Assert\Assert;
1517

18+
use function array_keys;
1619
use function preg_match;
1720
use function str_starts_with;
1821

@@ -41,6 +44,9 @@ private function factoryRepositorySet(string|null $requestedVersion): Repository
4144
}
4245
}
4346

47+
Assert::inArray($minimumStability, array_keys(BasePackage::STABILITIES));
48+
/** @psalm-var key-of<BasePackage::STABILITIES> $minimumStability */
49+
4450
$repositorySet = new RepositorySet($minimumStability);
4551
$repositorySet->addRepository(new CompositeRepository($this->composer->getRepositoryManager()->getRepositories()));
4652

0 commit comments

Comments
 (0)