From 4ae5c95c8d36b5b26e0990384dd2f478c66c314f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 26 Dec 2013 12:30:12 +0100 Subject: [PATCH] Detect require overrides, fixes #2503 --- src/Composer/Util/ConfigValidator.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Util/ConfigValidator.php b/src/Composer/Util/ConfigValidator.php index 7c6b321e6..82648d6d3 100644 --- a/src/Composer/Util/ConfigValidator.php +++ b/src/Composer/Util/ConfigValidator.php @@ -108,6 +108,11 @@ class ConfigValidator $warnings[] = "The package type 'composer-installer' is deprecated. Please distribute your custom installers as plugins from now on. See http://getcomposer.org/doc/articles/plugins.md for plugin documentation."; } + $requireOverrides = array_intersect_key($manifest['require'], $manifest['require-dev']); + if (!empty($requireOverrides)) { + $warnings[] = implode(', ', array_keys($requireOverrides)). " is required both in require and require-dev, this can lead to unexpected behavior"; + } + try { $loader = new ValidatingArrayLoader(new ArrayLoader()); if (!isset($manifest['version'])) {