4 * This file is part of Twig.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
13 * Lazy loads the runtime implementations for a Twig element.
15 * @author Robin Chalas <robin.chalas@gmail.com>
17 class Twig_FactoryRuntimeLoader implements Twig_RuntimeLoaderInterface
22 * @param array $map An array where keys are class names and values factory callables
24 public function __construct($map = array())
29 public function load($class)
31 if (isset($this->map[$class])) {
32 $runtimeFactory = $this->map[$class];
34 return $runtimeFactory();