services_uninitialized_ref.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 Symfony_DI_PhpDumper_Test_Uninitialized_Reference extends Container
  16. {
  17. private $parameters;
  18. private $targetDirs = array();
  19. public function __construct()
  20. {
  21. $this->services = array();
  22. $this->methodMap = array(
  23. 'bar' => 'getBarService',
  24. 'baz' => 'getBazService',
  25. 'foo1' => 'getFoo1Service',
  26. 'foo3' => 'getFoo3Service',
  27. );
  28. $this->privates = array(
  29. 'foo3' => true,
  30. );
  31. $this->aliases = array();
  32. }
  33. public function getRemovedIds()
  34. {
  35. return array(
  36. 'Psr\\Container\\ContainerInterface' => true,
  37. 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
  38. 'foo2' => true,
  39. 'foo3' => true,
  40. );
  41. }
  42. public function compile()
  43. {
  44. throw new LogicException('You cannot compile a dumped container that was already compiled.');
  45. }
  46. public function isCompiled()
  47. {
  48. return true;
  49. }
  50. public function isFrozen()
  51. {
  52. @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);
  53. return true;
  54. }
  55. /**
  56. * Gets the public 'bar' shared service.
  57. *
  58. * @return \stdClass
  59. */
  60. protected function getBarService()
  61. {
  62. $this->services['bar'] = $instance = new \stdClass();
  63. $instance->foo1 = ${($_ = isset($this->services['foo1']) ? $this->services['foo1'] : null) && false ?: '_'};
  64. $instance->foo2 = null;
  65. $instance->foo3 = ${($_ = isset($this->services['foo3']) ? $this->services['foo3'] : null) && false ?: '_'};
  66. $instance->closures = array(0 => function () {
  67. return ${($_ = isset($this->services['foo1']) ? $this->services['foo1'] : null) && false ?: '_'};
  68. }, 1 => function () {
  69. return null;
  70. }, 2 => function () {
  71. return ${($_ = isset($this->services['foo3']) ? $this->services['foo3'] : null) && false ?: '_'};
  72. });
  73. $instance->iter = new RewindableGenerator(function () {
  74. if (isset($this->services['foo1'])) {
  75. yield 'foo1' => ${($_ = isset($this->services['foo1']) ? $this->services['foo1'] : null) && false ?: '_'};
  76. }
  77. if (false) {
  78. yield 'foo2' => null;
  79. }
  80. if (isset($this->services['foo3'])) {
  81. yield 'foo3' => ${($_ = isset($this->services['foo3']) ? $this->services['foo3'] : null) && false ?: '_'};
  82. }
  83. }, function () {
  84. return 0 + (int) (isset($this->services['foo1'])) + (int) (false) + (int) (isset($this->services['foo3']));
  85. });
  86. return $instance;
  87. }
  88. /**
  89. * Gets the public 'baz' shared service.
  90. *
  91. * @return \stdClass
  92. */
  93. protected function getBazService()
  94. {
  95. $this->services['baz'] = $instance = new \stdClass();
  96. $instance->foo3 = ${($_ = isset($this->services['foo3']) ? $this->services['foo3'] : $this->services['foo3'] = new \stdClass()) && false ?: '_'};
  97. return $instance;
  98. }
  99. /**
  100. * Gets the public 'foo1' shared service.
  101. *
  102. * @return \stdClass
  103. */
  104. protected function getFoo1Service()
  105. {
  106. return $this->services['foo1'] = new \stdClass();
  107. }
  108. /**
  109. * Gets the private 'foo3' shared service.
  110. *
  111. * @return \stdClass
  112. */
  113. protected function getFoo3Service()
  114. {
  115. return $this->services['foo3'] = new \stdClass();
  116. }
  117. }