InstantiatorInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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. * Lazy proxy instantiator, capable of instantiating a proxy given a container, the
  15. * service definitions and a callback that produces the real service instance.
  16. *
  17. * @author Marco Pivetta <ocramius@gmail.com>
  18. */
  19. interface InstantiatorInterface
  20. {
  21. /**
  22. * Instantiates a proxy object.
  23. *
  24. * @param ContainerInterface $container The container from which the service is being requested
  25. * @param Definition $definition The definition of the requested service
  26. * @param string $id Identifier of the requested service
  27. * @param callable $realInstantiator Zero-argument callback that is capable of producing the real service instance
  28. *
  29. * @return object
  30. */
  31. public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator);
  32. }