diff options
Diffstat (limited to 'srcs/phpmyadmin/vendor/symfony/dependency-injection/Loader/ClosureLoader.php')
| -rw-r--r-- | srcs/phpmyadmin/vendor/symfony/dependency-injection/Loader/ClosureLoader.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/symfony/dependency-injection/Loader/ClosureLoader.php b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Loader/ClosureLoader.php new file mode 100644 index 0000000..939dd7c --- /dev/null +++ b/srcs/phpmyadmin/vendor/symfony/dependency-injection/Loader/ClosureLoader.php @@ -0,0 +1,48 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Loader\Loader; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * ClosureLoader loads service definitions from a PHP closure. + * + * The Closure has access to the container as its first argument. + * + * @author Fabien Potencier <fabien@symfony.com> + */ +class ClosureLoader extends Loader +{ + private $container; + + public function __construct(ContainerBuilder $container) + { + $this->container = $container; + } + + /** + * {@inheritdoc} + */ + public function load($resource, $type = null) + { + $resource($this->container); + } + + /** + * {@inheritdoc} + */ + public function supports($resource, $type = null) + { + return $resource instanceof \Closure; + } +} |
