Skip to content

Commit

Permalink
Fix new static analysis issue with minimumStability constants
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed Sep 7, 2024
1 parent f399ea2 commit d3ed0c4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
55 changes: 27 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/DependencyResolver/ResolveDependencyWithComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
namespace Php\Pie\DependencyResolver;

use Composer\Composer;
use Composer\Package\BasePackage;
use Composer\Package\CompletePackageInterface;
use Composer\Package\Version\VersionSelector;
use Composer\Repository\CompositeRepository;
use Composer\Repository\RepositorySet;
use Php\Pie\ExtensionType;
use Php\Pie\Platform\TargetPhp\ResolveTargetPhpToPlatformRepository;
use Php\Pie\Platform\TargetPlatform;
use Webmozart\Assert\Assert;

use function array_keys;
use function preg_match;
use function str_starts_with;

Expand Down Expand Up @@ -41,6 +44,9 @@ private function factoryRepositorySet(string|null $requestedVersion): Repository
}
}

Assert::inArray($minimumStability, array_keys(BasePackage::STABILITIES));
/** @var key-of<BasePackage::STABILITIES> $minimumStability */

Check failure on line 48 in src/DependencyResolver/ResolveDependencyWithComposer.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Missing variable $minimumStability before or after the documentation comment.

$repositorySet = new RepositorySet($minimumStability);
$repositorySet->addRepository(new CompositeRepository($this->composer->getRepositoryManager()->getRepositories()));

Expand Down

0 comments on commit d3ed0c4

Please sign in to comment.