From 49bd1d773b11d2396ba5a1a7a3f95cfba4455579 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 7 Jun 2015 17:44:56 -0700 Subject: [PATCH] Make an invalid package name a publish error, not warning Since invalid names will prevent publishing to packagist, they should be considered publish errors. If people do not plan on submitting their package to packagist, they can use the --no-check-publish flag to turn it into a normal warning again. --- src/Composer/Util/ConfigValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/ConfigValidator.php b/src/Composer/Util/ConfigValidator.php index c4eb645b5..eac5619e7 100644 --- a/src/Composer/Util/ConfigValidator.php +++ b/src/Composer/Util/ConfigValidator.php @@ -102,7 +102,7 @@ class ConfigValidator $suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $manifest['name']); $suggestName = strtolower($suggestName); - $warnings[] = sprintf( + $publishErrors[] = sprintf( 'Name "%s" does not match the best practice (e.g. lower-cased/with-dashes). We suggest using "%s" instead. As such you will not be able to submit it to Packagist.', $manifest['name'], $suggestName