Also check for package requiring itself in require, not only require-dev
parent
cd949745c3
commit
d271004b30
|
@ -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…
Reference in New Issue