Check for non-platform requirements before warning that no deps are installed on show command, fixes #11760
parent
4a209b7d3d
commit
12ed21705d
|
@ -258,8 +258,16 @@ EOT
|
|||
}, $packages))]);
|
||||
}
|
||||
|
||||
if (!$installedRepo->getPackages() && ($rootPkg->getRequires() || $rootPkg->getDevRequires())) {
|
||||
$io->writeError('<warning>No dependencies installed. Try running composer install or update.</warning>');
|
||||
if (!$installedRepo->getPackages()) {
|
||||
$hasNonPlatformReqs = static function (array $reqs): bool {
|
||||
return (bool) array_filter(array_keys($reqs), function (string $name) {
|
||||
return !PlatformRepository::isPlatformPackage($name);
|
||||
});
|
||||
};
|
||||
|
||||
if ($hasNonPlatformReqs($rootPkg->getRequires()) || $hasNonPlatformReqs($rootPkg->getDevRequires())) {
|
||||
$io->writeError('<warning>No dependencies installed. Try running composer install or update.</warning>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue