Ver código fonte

Clarified error message and added braces.

Niels Keurentjes 9 anos atrás
pai
commit
7b6ccde97a
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      src/Composer/Package/Loader/RootPackageLoader.php

+ 4 - 2
src/Composer/Package/Loader/RootPackageLoader.php

@@ -113,8 +113,10 @@ class RootPackageLoader extends ArrayLoader
             }
         }
 
-        if (isset($links[$config['name']]))
-            throw new \InvalidArgumentException(sprintf('Root package \'%s\' cannot require itself in its composer.json', $config['name']));
+        if (isset($links[$config['name']])) {
+            throw new \InvalidArgumentException(sprintf('Root package \'%s\' cannot require itself in its composer.json' . PHP_EOL .
+                        'Did you accidentally name your root package after an external package?', $config['name']));
+        }
 
         $realPackage->setAliases($aliases);
         $realPackage->setStabilityFlags($stabilityFlags);