Skip to content

Commit a9e82ee

Browse files
committed
Fix compatibility with semver 3
1 parent 0fc2cd9 commit a9e82ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ScriptExecutor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Composer\EventDispatcher\ScriptExecutionException;
1616
use Composer\IO\IOInterface;
1717
use Composer\Semver\Constraint\EmptyConstraint;
18+
use Composer\Semver\Constraint\MatchAllConstraint;
1819
use Composer\Util\ProcessExecutor;
1920
use Symfony\Component\Console\Output\OutputInterface;
2021
use Symfony\Component\Console\Output\StreamOutput;
@@ -93,7 +94,7 @@ private function expandCmd(string $type, string $cmd)
9394
private function expandSymfonyCmd(string $cmd)
9495
{
9596
$repo = $this->composer->getRepositoryManager()->getLocalRepository();
96-
if (!$repo->findPackage('symfony/console', new EmptyConstraint())) {
97+
if (!$repo->findPackage('symfony/console', \class_exists(MatchAllConstraint::class) ? new MatchAllConstraint(): new EmptyConstraint())) {
9798
$this->io->writeError(sprintf('<warning>Skipping "%s" (needs symfony/console to run).</>', $cmd));
9899

99100
return null;

0 commit comments

Comments
 (0)