vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php line 35

Open in your IDE?
  1. <?php
  2. namespace Doctrine\Common\Annotations;
  3. use function array_key_exists;
  4. use function class_exists;
  5. final class AnnotationRegistry
  6. {
  7.     /**
  8.      * An array of classes which cannot be found
  9.      *
  10.      * @var null[] indexed by class name
  11.      */
  12.     private static $failedToAutoload = [];
  13.     public static function reset(): void
  14.     {
  15.         self::$failedToAutoload = [];
  16.     }
  17.     /**
  18.      * Autoloads an annotation class silently.
  19.      */
  20.     public static function loadAnnotationClass(string $class): bool
  21.     {
  22.         if (class_exists($classfalse)) {
  23.             return true;
  24.         }
  25.         if (array_key_exists($classself::$failedToAutoload)) {
  26.             return false;
  27.         }
  28.         if (class_exists($class)) {
  29.             return true;
  30.         }
  31.         self::$failedToAutoload[$class] = null;
  32.         return false;
  33.     }
  34. }