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

main
Jordi Boggiano 4 years ago
parent cd949745c3
commit d271004b30
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -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);

Loading…
Cancel
Save