function MissingClassDetectionClassLoader::loadClass
Records missing classes and aliases missing traits.
This method is registered as a class loader during attribute discovery and runs last. Any call to this method means that the requested class is missing. If that class is a trait, it is aliased to a stub trait to avoid an uncaught PHP fatal error.
Parameters
string $class: The class name to load.
File
- 
              core/lib/ Drupal/ Component/ Discovery/ MissingClassDetectionClassLoader.php, line 45 
Class
- MissingClassDetectionClassLoader
- Defines a classloader that detects missing classes.
Namespace
Drupal\Component\DiscoveryCode
public function loadClass(string $class) : void {
  $this->missingClass = TRUE;
  if (str_ends_with($class, 'Trait')) {
    $this->missingTraits[] = $class;
    class_alias(StubTrait::class, $class);
  }
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
