DumperInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * @param Definition $definition
  23. *
  24. * @return bool
  25. */
  26. public function isProxyCandidate(Definition $definition);
  27. /**
  28. * Generates the code to be used to instantiate a proxy in the dumped factory code.
  29. *
  30. * @param Definition $definition
  31. * @param string $id service identifier
  32. *
  33. * @return string
  34. */
  35. public function getProxyFactoryCode(Definition $definition, $id);
  36. /**
  37. * Generates the code for the lazy proxy.
  38. *
  39. * @param Definition $definition
  40. *
  41. * @return string
  42. */
  43. public function getProxyCode(Definition $definition);
  44. }