1
0
Fork 0

Adds warning when the version field is set, fixes composer/packagist#438

pull/3271/head
Jordi Boggiano 2014-09-10 16:11:05 +01:00
parent 0e409a159c
commit d79f2b0fd3
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ class ConfigValidator
$warnings[] = 'No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.';
}
if (isset($manifest['version'])) {
$warnings[] = 'The version field is present, it is recommended to leave it out if the package is published on Packagist.';
}
if (!empty($manifest['name']) && preg_match('{[A-Z]}', $manifest['name'])) {
$suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\1\\3-\\2\\4', $manifest['name']);
$suggestName = strtolower($suggestName);