public function DebugUniversalClassLoader::loadClass

Loads the given class or interface.

Parameters

string $class The name of the class:

Overrides UniversalClassLoader::loadClass

File

drupal/core/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php, line 53

Class

DebugUniversalClassLoader
Checks that the class is actually declared in the included file.

Namespace

Symfony\Component\ClassLoader

Code

public function loadClass($class) {
  if ($file = $this
    ->findFile($class)) {
    require $file;
    if (!class_exists($class, false) && !interface_exists($class, false) && (!function_exists('trait_exists') || !trait_exists($class, false))) {
      throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
    }
  }
}