services19.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
  3. use Symfony\Component\DependencyInjection\ContainerInterface;
  4. use Symfony\Component\DependencyInjection\Container;
  5. use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
  6. use Symfony\Component\DependencyInjection\Exception\LogicException;
  7. use Symfony\Component\DependencyInjection\Exception\RuntimeException;
  8. use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
  9. /**
  10. * This class has been auto-generated
  11. * by the Symfony Dependency Injection Component.
  12. *
  13. * @final since Symfony 3.3
  14. */
  15. class ProjectServiceContainer extends Container
  16. {
  17. private $parameters;
  18. private $targetDirs = array();
  19. public function __construct()
  20. {
  21. $this->services = array();
  22. $this->methodMap = array(
  23. 'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService',
  24. 'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService',
  25. );
  26. $this->aliases = array();
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function compile()
  32. {
  33. throw new LogicException('You cannot compile a dumped container that was already compiled.');
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function isCompiled()
  39. {
  40. return true;
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function isFrozen()
  46. {
  47. @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED);
  48. return true;
  49. }
  50. /**
  51. * Gets the public 'service_from_anonymous_factory' shared service.
  52. *
  53. * @return \Bar\FooClass
  54. */
  55. protected function getServiceFromAnonymousFactoryService()
  56. {
  57. return $this->services['service_from_anonymous_factory'] = (new \Bar\FooClass())->getInstance();
  58. }
  59. /**
  60. * Gets the public 'service_with_method_call_and_factory' shared service.
  61. *
  62. * @return \Bar\FooClass
  63. */
  64. protected function getServiceWithMethodCallAndFactoryService()
  65. {
  66. $this->services['service_with_method_call_and_factory'] = $instance = new \Bar\FooClass();
  67. $instance->setBar(\Bar\FooClass::getInstance());
  68. return $instance;
  69. }
  70. }