[ Index ] |
PHP Cross Reference of phpBB-3.1.12-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 * This file is part of the Symfony package. 5 * 6 * (c) Fabien Potencier <fabien@symfony.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12 namespace Symfony\Component\DependencyInjection\Loader; 13 14 use Symfony\Component\DependencyInjection\ContainerBuilder; 15 use Symfony\Component\Config\Loader\Loader; 16 17 /** 18 * ClosureLoader loads service definitions from a PHP closure. 19 * 20 * The Closure has access to the container as its first argument. 21 * 22 * @author Fabien Potencier <fabien@symfony.com> 23 */ 24 class ClosureLoader extends Loader 25 { 26 private $container; 27 28 /** 29 * @param ContainerBuilder $container A ContainerBuilder instance 30 */ 31 public function __construct(ContainerBuilder $container) 32 { 33 $this->container = $container; 34 } 35 36 /** 37 * {@inheritdoc} 38 */ 39 public function load($resource, $type = null) 40 { 41 call_user_func($resource, $this->container); 42 } 43 44 /** 45 * {@inheritdoc} 46 */ 47 public function supports($resource, $type = null) 48 { 49 return $resource instanceof \Closure; 50 } 51 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Jan 11 00:25:41 2018 | Cross-referenced by PHPXref 0.7.1 |