class FactoryRuntimeLoader
Lazy loads the runtime implementations for a Twig element.
@author Robin Chalas <robin.chalas@gmail.com>
Hierarchy
- class \Twig\RuntimeLoader\FactoryRuntimeLoader implements \Twig\RuntimeLoader\RuntimeLoaderInterface
Expanded class hierarchy of FactoryRuntimeLoader
1 file declares its use of FactoryRuntimeLoader
- Environment.php in vendor/
twig/ twig/ src/ Environment.php
File
-
vendor/
twig/ twig/ src/ RuntimeLoader/ FactoryRuntimeLoader.php, line 19
Namespace
Twig\RuntimeLoaderView source
class FactoryRuntimeLoader implements RuntimeLoaderInterface {
/**
* @param array $map An array where keys are class names and values factory callables
*/
public function __construct(array $map = []) {
}
public function load(string $class) {
if (!isset($this->map[$class])) {
return null;
}
$runtimeFactory = $this->map[$class];
return $runtimeFactory();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
FactoryRuntimeLoader::load | public | function | Creates the runtime implementation of a Twig element (filter/function/test). | Overrides RuntimeLoaderInterface::load |
FactoryRuntimeLoader::__construct | public | function |