class ClosureLoader in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php \Symfony\Component\DependencyInjection\Loader\ClosureLoader
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>
Hierarchy
- class \Symfony\Component\DependencyInjection\Loader\ClosureLoader extends \Symfony\Component\Config\Loader\Loader
Expanded class hierarchy of ClosureLoader
2 files declare their use of ClosureLoader
- ClosureLoaderTest.php in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Loader/ ClosureLoaderTest.php - ContainerBuilderTest.php in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerBuilderTest.php
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Loader/ ClosureLoader.php, line 24
Namespace
Symfony\Component\DependencyInjection\LoaderView source
class ClosureLoader extends Loader {
private $container;
/**
* Constructor.
*
* @param ContainerBuilder $container A ContainerBuilder instance
*/
public function __construct(ContainerBuilder $container) {
$this->container = $container;
}
/**
* {@inheritdoc}
*/
public function load($resource, $type = null) {
call_user_func($resource, $this->container);
}
/**
* {@inheritdoc}
*/
public function supports($resource, $type = null) {
return $resource instanceof \Closure;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ClosureLoader:: |
private | property | ||
ClosureLoader:: |
public | function | ||
ClosureLoader:: |
public | function | ||
ClosureLoader:: |
public | function | Constructor. |