Fix: ValidatingArrayLoader [TypeError]: strcasecmp(): Argument #1() must be of type string, int given (#10897)
parent
30a8b82b15
commit
6776cef441
|
@ -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]);
|
||||
|
|
|
@ -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")')
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue