1
0
Fork 0

Merge branch '2.3' into main

pull/10899/head
Jordi Boggiano 2022-06-24 11:10:07 +02:00
commit 4229c2c641
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 8 additions and 9 deletions

View File

@ -252,6 +252,7 @@ class ValidatingArrayLoader implements LoaderInterface
foreach (array_keys(BasePackage::$supportedLinkTypes) as $linkType) {
if ($this->validateArray($linkType) && isset($this->config[$linkType])) {
foreach ($this->config[$linkType] as $package => $constraint) {
$package = (string) $package;
if (0 === strcasecmp($package, $this->config['name'])) {
$this->errors[] = $linkType.'.'.$package.' : a package cannot set a '.$linkType.' on itself';
unset($this->config[$linkType][$package]);

View File

@ -115,15 +115,6 @@ interface RootPackageInterface extends CompletePackageInterface
*/
public function setReplaces(array $replaces): void;
/**
* Set the repositories
*
* @param mixed[] $repositories
*
* @return void
*/
public function setRepositories(array $repositories): void;
/**
* Set the autoload mapping
*

View File

@ -419,6 +419,13 @@ class ValidatingArrayLoaderTest extends TestCase
'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")')
),
));
}