Browse Source

Add deprecation warning for name attribute

Patrick Reimers 6 years ago
parent
commit
8ae8d131d5
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Composer/Package/Loader/ValidatingArrayLoader.php

+ 4 - 0
src/Composer/Package/Loader/ValidatingArrayLoader.php

@@ -49,6 +49,10 @@ class ValidatingArrayLoader implements LoaderInterface
         $this->warnings = array();
         $this->config = $config;
 
+        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.';
+        }
+
         if ($this->strictName) {
             $this->validateRegex('name', '[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*', true);
         } else {