From 627a832cc15f9321cbf97eb5692e515800b30f6f Mon Sep 17 00:00:00 2001 From: Patrick Reimers Date: Fri, 1 Mar 2019 19:39:07 +0100 Subject: [PATCH] Return non zero exit code on deprecation --- src/Composer/Package/Loader/ValidatingArrayLoader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Package/Loader/ValidatingArrayLoader.php b/src/Composer/Package/Loader/ValidatingArrayLoader.php index 405e567f0..a8aa65331 100644 --- a/src/Composer/Package/Loader/ValidatingArrayLoader.php +++ b/src/Composer/Package/Loader/ValidatingArrayLoader.php @@ -195,7 +195,9 @@ 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) { - if (!preg_match('{^[A-Za-z0-9_./-]+$}', $package)) { + if ($err = self::hasPackageNamingError($package, true)) { + $this->warnings[] = 'Deprecation warning: '.$linkType.'.'.$err.' Make sure you fix this as Composer 2.0 will error.'; + } 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_./-]'; } if (!is_string($constraint)) {