Skip to content

Commit

Permalink
#135 AnnotationRegistry::$failedToAutoload is now null[]
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jul 22, 2017
1 parent 8750460 commit 769c329
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Doctrine/Common/Annotations/AnnotationRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class AnnotationRegistry
/**
* An array of classes which cannot be found
*
* @var array
* @var null[] indexed by class name
*/
static private $failedToAutoload = array();

Expand Down Expand Up @@ -133,9 +133,10 @@ static public function loadAnnotationClass($class)
return true;
}

if (isset(self::$failedToAutoload[$class])) {
if (\array_key_exists($class, self::$failedToAutoload[$class])) {
return false;
}

foreach (self::$autoloadNamespaces AS $namespace => $dirs) {
if (strpos($class, $namespace) === 0) {
$file = str_replace("\\", DIRECTORY_SEPARATOR, $class) . ".php";
Expand All @@ -160,7 +161,9 @@ static public function loadAnnotationClass($class)
return true;
}
}
self::$failedToAutoload[$class] = true;

self::$failedToAutoload[$class] = null;

return false;
}
}

0 comments on commit 769c329

Please sign in to comment.