DumperInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\PhpDumper;
  11. use Symfony\Component\DependencyInjection\Definition;
  12. /**
  13. * Lazy proxy dumper capable of generating the instantiation logic PHP code for proxied services.
  14. *
  15. * @author Marco Pivetta <ocramius@gmail.com>
  16. */
  17. interface DumperInterface
  18. {
  19. /**
  20. * Inspects whether the given definitions should produce proxy instantiation logic in the dumped container.
  21. *
  22. * @return bool
  23. */
  24. public function isProxyCandidate(Definition $definition);
  25. /**
  26. * Generates the code to be used to instantiate a proxy in the dumped factory code.
  27. *
  28. * @param Definition $definition
  29. * @param string $id Service identifier
  30. *
  31. * @return string
  32. */
  33. public function getProxyFactoryCode(Definition $definition, $id);
  34. /**
  35. * Generates the code for the lazy proxy.
  36. *
  37. * @return string
  38. */
  39. public function getProxyCode(Definition $definition);
  40. }