1
0
Fork 0

Turn naming errors into hard failures in validating array loader

pull/10308/head
Jordi Boggiano 2021-11-25 10:20:47 +01:00
parent f12a5b8214
commit c15eba3fe3
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class ValidatingArrayLoader implements LoaderInterface
$this->config = $config; $this->config = $config;
if ($err = self::hasPackageNamingError($config['name'])) { if ($err = self::hasPackageNamingError($config['name'])) {
$this->warnings[] = 'Deprecation warning: Your package name '.$err.' Make sure you fix this as Composer 2.0 will error.'; $this->errors[] = 'Your package name '.$err;
} }
if ($this->strictName) { if ($this->strictName) {
@ -247,7 +247,7 @@ class ValidatingArrayLoader implements LoaderInterface
continue; continue;
} }
if ($err = self::hasPackageNamingError($package, true)) { if ($err = self::hasPackageNamingError($package, true)) {
$this->warnings[] = 'Deprecation warning: '.$linkType.'.'.$err.' Make sure you fix this as Composer 2.0 will error.'; $this->errors[] = $linkType.'.'.$err;
} elseif (!preg_match('{^[A-Za-z0-9_./-]+$}', $package)) { } elseif (!preg_match('{^[A-Za-z0-9_./-]+$}', $package)) {
$this->warnings[] = $linkType.'.'.$package.' : invalid key, package names must be strings containing only [A-Za-z0-9_./-]'; $this->warnings[] = $linkType.'.'.$package.' : invalid key, package names must be strings containing only [A-Za-z0-9_./-]';
} }