1
0
Fork 0

Also check for package requiring itself in require, not only require-dev

pull/8682/head
Jordi Boggiano 2020-03-10 17:00:28 +01:00
parent cd949745c3
commit d271004b30
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 5 deletions

View File

@ -139,6 +139,11 @@ class RootPackageLoader extends ArrayLoader
$aliases = $this->extractAliases($links, $aliases);
$stabilityFlags = $this->extractStabilityFlags($links, $stabilityFlags, $realPackage->getMinimumStability());
$references = $this->extractReferences($links, $references);
if (isset($links[$config['name']])) {
throw new \RuntimeException(sprintf('Root package \'%s\' cannot require itself in its composer.json' . PHP_EOL .
'Did you accidentally name your root package after an external package?', $config['name']));
}
}
}
@ -154,11 +159,6 @@ class RootPackageLoader extends ArrayLoader
}
}
if (isset($links[$config['name']])) {
throw new \InvalidArgumentException(sprintf('Root package \'%s\' cannot require itself in its composer.json' . PHP_EOL .
'Did you accidentally name your root package after an external package?', $config['name']));
}
$realPackage->setAliases($aliases);
$realPackage->setStabilityFlags($stabilityFlags);
$realPackage->setReferences($references);