Skip to content

Commit

Permalink
Trigger the standard autoloader as the last resort
Browse files Browse the repository at this point in the history
As v2 isn't here yet, and looking at doctrine#232 it is unclear if will, and as we have to put up with annoying deprecated functions, here I propose to fall back to the standard autoloader if nothing else worked, and if there's no custom loader defined.

Fixes doctrine#270
  • Loading branch information
sanmai authored and alcaeus committed Apr 2, 2020
1 parent f9deab6 commit c499bb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Doctrine/Common/Annotations/AnnotationRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ public static function loadAnnotationClass(string $class) : bool
return true;
}
}

if (self::$loaders === [] && self::$autoloadNamespaces === [] && \class_exists($class)) {
return true;
}

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

Expand Down

0 comments on commit c499bb9

Please sign in to comment.