File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/RuntimeLoader.tar
Back
ContainerRuntimeLoader.php 0000644 00000001553 15030771633 0011703 0 ustar 00 <?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Twig\RuntimeLoader; use Psr\Container\ContainerInterface; /** * Lazily loads Twig runtime implementations from a PSR-11 container. * * Note that the runtime services MUST use their class names as identifiers. * * @author Fabien Potencier <fabien@symfony.com> * @author Robin Chalas <robin.chalas@gmail.com> */ class ContainerRuntimeLoader implements RuntimeLoaderInterface { private $container; public function __construct(ContainerInterface $container) { $this->container = $container; } public function load(string $class) { return $this->container->has($class) ? $this->container->get($class) : null; } } FactoryRuntimeLoader.php 0000644 00000001515 15030771633 0011366 0 ustar 00 <?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Twig\RuntimeLoader; /** * Lazy loads the runtime implementations for a Twig element. * * @author Robin Chalas <robin.chalas@gmail.com> */ class FactoryRuntimeLoader implements RuntimeLoaderInterface { private $map; /** * @param array $map An array where keys are class names and values factory callables */ public function __construct(array $map = []) { $this->map = $map; } public function load(string $class) { if (!isset($this->map[$class])) { return null; } $runtimeFactory = $this->map[$class]; return $runtimeFactory(); } } RuntimeLoaderInterface.php 0000644 00000001253 15030771633 0011656 0 ustar 00 <?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Twig\RuntimeLoader; /** * Creates runtime implementations for Twig elements (filters/functions/tests). * * @author Fabien Potencier <fabien@symfony.com> */ interface RuntimeLoaderInterface { /** * Creates the runtime implementation of a Twig element (filter/function/test). * * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class */ public function load(string $class); }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings