优化Loader类

This commit is contained in:
yunwuxin
2016-06-30 16:20:52 +08:00
parent 391522fa6a
commit f4444fd46f
2 changed files with 66 additions and 13 deletions

View File

@@ -79,7 +79,7 @@ EOF;
foreach ($this->createMap($dir, $namespace) as $class => $path) {
$pathCode = $this->getPathCode($path) . ",\n";
// dump($pathCode);
if (!isset($classMap[$class])) {
$classMap[$class] = $pathCode;
} elseif ($classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class] . ' ' . $path, '\\', '/'))) {