CallableExtension.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Component\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  13. class CallableExtension implements ExtensionInterface
  14. {
  15. private $callable;
  16. private $alias;
  17. public function __construct($callable, $alias)
  18. {
  19. $this->callable = $callable;
  20. $this->alias = $alias;
  21. }
  22. public function load(array $configs, ContainerBuilder $container)
  23. {
  24. call_user_func($this->callable, $configs, $container);
  25. }
  26. public function getAlias()
  27. {
  28. return $this->alias;
  29. }
  30. public function getNamespace()
  31. {
  32. return false;
  33. }
  34. public function getXsdValidationBasePath()
  35. {
  36. return false;
  37. }
  38. }