DumperInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * @return string
  29. */
  30. public function getProxyFactoryCode(Definition $definition, string $id, string $factoryCode);
  31. /**
  32. * Generates the code for the lazy proxy.
  33. *
  34. * @return string
  35. */
  36. public function getProxyCode(Definition $definition);
  37. }