Avoid ambiguity warning for example directories as well

In particular, PEAR repositories use a classmap and example directories trigger
multiple false positive warnings.
main
Denis Sokolov 10 years ago committed by Denis Sokolov
parent 65b9cca7b5
commit 836534067b

@ -84,7 +84,7 @@ class ClassMapGenerator
foreach ($classes as $class) {
if (!isset($map[$class])) {
$map[$class] = $filePath;
} elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) {
} elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture|example)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) {
$io->write(
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'

@ -170,7 +170,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
"
);
foreach (array('test', 'fixture') as $keyword) {
foreach (array('test', 'fixture', 'example') as $keyword) {
if (!is_dir($tempDir.'/'.$keyword)) {
mkdir($tempDir.'/'.$keyword, 0777, true);
}

Loading…
Cancel
Save