Skip to content

Commit

Permalink
#135 removed loaded class cache - PHP already provides such a map
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jul 22, 2017
1 parent 2258a55 commit 0a1b8d7
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/Doctrine/Common/Annotations/AnnotationRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ final class AnnotationRegistry
*/
static private $loaders = array();

/**
* An array of loaded classes
*
* @var array
*/
static private $successfullyLoaded = array();

/**
* An array of classes which cannot be found
*
Expand All @@ -64,7 +57,6 @@ static public function reset()
{
self::$autoloadNamespaces = array();
self::$loaders = array();
self::$successfullyLoaded = array();
self::$failedToAutoload = array();
}

Expand Down Expand Up @@ -127,7 +119,6 @@ static public function registerLoader($callable)
throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader().");
}
// Reset our static cache now that we have a new loader to work with
self::$successfullyLoaded = array();
self::$failedToAutoload = array();
self::$loaders[] = $callable;
}
Expand All @@ -154,14 +145,12 @@ static public function loadAnnotationClass($class)
if ($dirs === null) {
if ($path = stream_resolve_include_path($file)) {
require $path;
self::$successfullyLoaded[$class] = true;
return true;
}
} else {
foreach((array)$dirs AS $dir) {
if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
require $dir . DIRECTORY_SEPARATOR . $file;
self::$successfullyLoaded[$class] = true;
return true;
}
}
Expand All @@ -171,7 +160,6 @@ static public function loadAnnotationClass($class)

foreach (self::$loaders AS $loader) {
if (call_user_func($loader, $class) === true) {
self::$successfullyLoaded[$class] = true;
return true;
}
}
Expand Down

0 comments on commit 0a1b8d7

Please sign in to comment.