-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathVersionProblemCommandTrait.php
More file actions
35 lines (29 loc) · 1.35 KB
/
VersionProblemCommandTrait.php
File metadata and controls
35 lines (29 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\AssetMapper\Command;
use Symfony\Component\AssetMapper\ImportMap\ImportMapVersionChecker;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @internal
*/
trait VersionProblemCommandTrait
{
private function renderVersionProblems(ImportMapVersionChecker $importMapVersionChecker, OutputInterface $output): void
{
$problems = $importMapVersionChecker->checkVersions();
foreach ($problems as $problem) {
if (null === $problem->installedVersion) {
$output->writeln(\sprintf('[warning] <info>%s</info> requires <info>%s</info> but it is not in the importmap.php. You may need to run "php bin/console importmap:require %s".', $problem->packageName, $problem->dependencyPackageName, $problem->dependencyPackageName));
continue;
}
$output->writeln(\sprintf('[warning] <info>%s</info> requires <info>%s</info>@<comment>%s</comment> but version <comment>%s</comment> is installed.', $problem->packageName, $problem->dependencyPackageName, $problem->requiredVersionConstraint, $problem->installedVersion));
}
}
}