Merge branch '2.3' into main
commit
4229c2c641
|
@ -252,6 +252,7 @@ class ValidatingArrayLoader implements LoaderInterface
|
||||||
foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) {
|
foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) {
|
||||||
if ($this->validateArray($linkType) && isset($this->config[$linkType])) {
|
if ($this->validateArray($linkType) && isset($this->config[$linkType])) {
|
||||||
foreach ($this->config[$linkType] as $package => $constraint) {
|
foreach ($this->config[$linkType] as $package => $constraint) {
|
||||||
|
$package = (string) $package;
|
||||||
if (0 === strcasecmp($package, $this->config['name'])) {
|
if (0 === strcasecmp($package, $this->config['name'])) {
|
||||||
$this->errors[] = $linkType.'.'.$package.' : a package cannot set a '.$linkType.' on itself';
|
$this->errors[] = $linkType.'.'.$package.' : a package cannot set a '.$linkType.' on itself';
|
||||||
unset($this->config[$linkType][$package]);
|
unset($this->config[$linkType][$package]);
|
||||||
|
|
|
@ -115,15 +115,6 @@ interface RootPackageInterface extends CompletePackageInterface
|
||||||
*/
|
*/
|
||||||
public function setReplaces(array $replaces): void;
|
public function setReplaces(array $replaces): void;
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the repositories
|
|
||||||
*
|
|
||||||
* @param mixed[] $repositories
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setRepositories(array $repositories): void;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the autoload mapping
|
* Set the autoload mapping
|
||||||
*
|
*
|
||||||
|
|
|
@ -419,6 +419,13 @@ class ValidatingArrayLoaderTest extends TestCase
|
||||||
'dist.url : must be present',
|
'dist.url : must be present',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
array(
|
||||||
|
'name' => 'foo/bar',
|
||||||
|
'replace' => array('acme/bar'),
|
||||||
|
),
|
||||||
|
array('replace.0 : invalid version constraint (Could not parse version constraint acme/bar: Invalid version string "acme/bar")')
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue