RealServiceInstantiator.php 873 B

123456789101112131415161718192021222324252627282930313233
  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\Component\DependencyInjection\LazyProxy\Instantiator;
  11. use Symfony\Component\DependencyInjection\ContainerInterface;
  12. use Symfony\Component\DependencyInjection\Definition;
  13. /**
  14. * {@inheritdoc}
  15. *
  16. * Noop proxy instantiator - produces the real service instead of a proxy instance.
  17. *
  18. * @author Marco Pivetta <ocramius@gmail.com>
  19. */
  20. class RealServiceInstantiator implements InstantiatorInterface
  21. {
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function instantiateProxy(ContainerInterface $container, Definition $definition, string $id, callable $realInstantiator)
  26. {
  27. return $realInstantiator();
  28. }
  29. }