X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FFactoryRuntimeLoader.php;fp=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FFactoryRuntimeLoader.php;h=f428047ca0f7562b55a47c825fed7f6ae545bf43;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php b/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php new file mode 100644 index 000000000..f428047ca --- /dev/null +++ b/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php @@ -0,0 +1,37 @@ + + */ +class Twig_FactoryRuntimeLoader implements Twig_RuntimeLoaderInterface +{ + private $map; + + /** + * @param array $map An array where keys are class names and values factory callables + */ + public function __construct($map = array()) + { + $this->map = $map; + } + + public function load($class) + { + if (isset($this->map[$class])) { + $runtimeFactory = $this->map[$class]; + + return $runtimeFactory(); + } + } +}