1
0
Fork 0

Downgrade naming errors to warnings again in package links to avoid BC issues with tags on packagist

pull/10757/head
Jordi Boggiano 2022-04-29 14:58:38 +02:00
parent da322643d6
commit f1f013edde
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 14 additions and 14 deletions

View File

@ -258,9 +258,9 @@ class ValidatingArrayLoader implements LoaderInterface
continue;
}
if ($err = self::hasPackageNamingError($package, true)) {
$this->errors[] = $linkType.'.'.$err;
$this->warnings[] = $linkType.'.'.$err;
} elseif (!Preg::isMatch('{^[A-Za-z0-9_./-]+$}', $package)) {
$this->warnings[] = $linkType.'.'.$package.' : invalid key, package names must be strings containing only [A-Za-z0-9_./-]';
$this->errors[] = $linkType.'.'.$package.' : invalid key, package names must be strings containing only [A-Za-z0-9_./-]';
}
if (!is_string($constraint)) {
$this->errors[] = $linkType.'.'.$package.' : invalid value, must be a string containing a version constraint';

View File

@ -352,18 +352,6 @@ class ValidatingArrayLoaderTest extends TestCase
'name : Foo/Bar is invalid, it should not contain uppercase characters. We suggest using foo/bar instead.',
),
),
array(
array(
'name' => 'foo/bar',
'require' => array(
'Foo/Baz' => '^1.0',
),
),
array(
'require.Foo/Baz is invalid, it should not contain uppercase characters. Please use foo/baz instead.',
),
false,
),
array(
array(
'name' => 'foo/bar',
@ -523,6 +511,18 @@ class ValidatingArrayLoaderTest extends TestCase
),
false,
),
array(
array(
'name' => 'foo/bar',
'require' => array(
'Foo/Baz' => '^1.0',
),
),
array(
'require.Foo/Baz is invalid, it should not contain uppercase characters. Please use foo/baz instead.',
),
false,
),
);
}
}