DumperInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * @param string $methodName The method name to get the service, will be added to the interface in 4.0
  31. *
  32. * @return string
  33. */
  34. public function getProxyFactoryCode(Definition $definition, $id/**, $methodName = null */);
  35. /**
  36. * Generates the code for the lazy proxy.
  37. *
  38. * @return string
  39. */
  40. public function getProxyCode(Definition $definition);
  41. }