Avoid ambiguity warning for example directories as well
In particular, PEAR repositories use a classmap and example directories trigger multiple false positive warnings.pull/2895/head
parent
65b9cca7b5
commit
836534067b
|
@ -84,7 +84,7 @@ class ClassMapGenerator
|
||||||
foreach ($classes as $class) {
|
foreach ($classes as $class) {
|
||||||
if (!isset($map[$class])) {
|
if (!isset($map[$class])) {
|
||||||
$map[$class] = $filePath;
|
$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(
|
$io->write(
|
||||||
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
|
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
|
||||||
' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'
|
' 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)) {
|
if (!is_dir($tempDir.'/'.$keyword)) {
|
||||||
mkdir($tempDir.'/'.$keyword, 0777, true);
|
mkdir($tempDir.'/'.$keyword, 0777, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue