class ClosureLoader in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/symfony/routing/Loader/ClosureLoader.php \Symfony\Component\Routing\Loader\ClosureLoader
- 8.0 vendor/symfony/dependency-injection/Loader/ClosureLoader.php \Symfony\Component\DependencyInjection\Loader\ClosureLoader
Same name and namespace in other branches
- 8 vendor/symfony/dependency-injection/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
3 files declare their use of ClosureLoader
- ClosureLoaderTest.php in vendor/
symfony/ dependency-injection/ Tests/ Loader/ ClosureLoaderTest.php - ContainerBuilderTest.php in vendor/
symfony/ dependency-injection/ Tests/ ContainerBuilderTest.php - Kernel.php in vendor/
symfony/ http-kernel/ Kernel.php
File
- vendor/
symfony/ dependency-injection/ 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. |