services9_compiled.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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->parameters = $this->getDefaultParameters();
  22. $this->services = array();
  23. $this->methodMap = array(
  24. 'bar' => 'getBarService',
  25. 'baz' => 'getBazService',
  26. 'configured_service' => 'getConfiguredServiceService',
  27. 'configured_service_simple' => 'getConfiguredServiceSimpleService',
  28. 'decorator_service' => 'getDecoratorServiceService',
  29. 'decorator_service_with_name' => 'getDecoratorServiceWithNameService',
  30. 'deprecated_service' => 'getDeprecatedServiceService',
  31. 'factory_service' => 'getFactoryServiceService',
  32. 'factory_service_simple' => 'getFactoryServiceSimpleService',
  33. 'foo' => 'getFooService',
  34. 'foo.baz' => 'getFoo_BazService',
  35. 'foo_bar' => 'getFooBarService',
  36. 'foo_with_inline' => 'getFooWithInlineService',
  37. 'lazy_context' => 'getLazyContextService',
  38. 'lazy_context_ignore_invalid_ref' => 'getLazyContextIgnoreInvalidRefService',
  39. 'method_call1' => 'getMethodCall1Service',
  40. 'new_factory_service' => 'getNewFactoryServiceService',
  41. 'service_from_static_method' => 'getServiceFromStaticMethodService',
  42. );
  43. $this->aliases = array(
  44. 'alias_for_alias' => 'foo',
  45. 'alias_for_foo' => 'foo',
  46. 'decorated' => 'decorator_service_with_name',
  47. );
  48. }
  49. /**
  50. * {@inheritdoc}
  51. */
  52. public function compile()
  53. {
  54. throw new LogicException('You cannot compile a dumped container that was already compiled.');
  55. }
  56. /**
  57. * {@inheritdoc}
  58. */
  59. public function isCompiled()
  60. {
  61. return true;
  62. }
  63. /**
  64. * {@inheritdoc}
  65. */
  66. public function isFrozen()
  67. {
  68. @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);
  69. return true;
  70. }
  71. /**
  72. * Gets the public 'bar' shared service.
  73. *
  74. * @return \Bar\FooClass
  75. */
  76. protected function getBarService()
  77. {
  78. $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
  79. $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
  80. $a->configure($instance);
  81. return $instance;
  82. }
  83. /**
  84. * Gets the public 'baz' shared service.
  85. *
  86. * @return \Baz
  87. */
  88. protected function getBazService()
  89. {
  90. $this->services['baz'] = $instance = new \Baz();
  91. $instance->setFoo(${($_ = isset($this->services['foo_with_inline']) ? $this->services['foo_with_inline'] : $this->get('foo_with_inline')) && false ?: '_'});
  92. return $instance;
  93. }
  94. /**
  95. * Gets the public 'configured_service' shared service.
  96. *
  97. * @return \stdClass
  98. */
  99. protected function getConfiguredServiceService()
  100. {
  101. $a = new \ConfClass();
  102. $a->setFoo(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->get('baz')) && false ?: '_'});
  103. $this->services['configured_service'] = $instance = new \stdClass();
  104. $a->configureStdClass($instance);
  105. return $instance;
  106. }
  107. /**
  108. * Gets the public 'configured_service_simple' shared service.
  109. *
  110. * @return \stdClass
  111. */
  112. protected function getConfiguredServiceSimpleService()
  113. {
  114. $this->services['configured_service_simple'] = $instance = new \stdClass();
  115. (new \ConfClass('bar'))->configureStdClass($instance);
  116. return $instance;
  117. }
  118. /**
  119. * Gets the public 'decorator_service' shared service.
  120. *
  121. * @return \stdClass
  122. */
  123. protected function getDecoratorServiceService()
  124. {
  125. return $this->services['decorator_service'] = new \stdClass();
  126. }
  127. /**
  128. * Gets the public 'decorator_service_with_name' shared service.
  129. *
  130. * @return \stdClass
  131. */
  132. protected function getDecoratorServiceWithNameService()
  133. {
  134. return $this->services['decorator_service_with_name'] = new \stdClass();
  135. }
  136. /**
  137. * Gets the public 'deprecated_service' shared service.
  138. *
  139. * @return \stdClass
  140. *
  141. * @deprecated The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.
  142. */
  143. protected function getDeprecatedServiceService()
  144. {
  145. @trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.', E_USER_DEPRECATED);
  146. return $this->services['deprecated_service'] = new \stdClass();
  147. }
  148. /**
  149. * Gets the public 'factory_service' shared service.
  150. *
  151. * @return \Bar
  152. */
  153. protected function getFactoryServiceService()
  154. {
  155. return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'}->getInstance();
  156. }
  157. /**
  158. * Gets the public 'factory_service_simple' shared service.
  159. *
  160. * @return \Bar
  161. */
  162. protected function getFactoryServiceSimpleService()
  163. {
  164. return $this->services['factory_service_simple'] = (new \SimpleFactoryClass('foo'))->getInstance();
  165. }
  166. /**
  167. * Gets the public 'foo' shared service.
  168. *
  169. * @return \Bar\FooClass
  170. */
  171. protected function getFooService()
  172. {
  173. $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
  174. $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
  175. $instance->foo = 'bar';
  176. $instance->moo = $a;
  177. $instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar');
  178. $instance->setBar(${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->get('bar')) && false ?: '_'});
  179. $instance->initialize();
  180. sc_configure($instance);
  181. return $instance;
  182. }
  183. /**
  184. * Gets the public 'foo.baz' shared service.
  185. *
  186. * @return \BazClass
  187. */
  188. protected function getFoo_BazService()
  189. {
  190. $this->services['foo.baz'] = $instance = \BazClass::getInstance();
  191. \BazClass::configureStatic1($instance);
  192. return $instance;
  193. }
  194. /**
  195. * Gets the public 'foo_bar' service.
  196. *
  197. * @return \Bar\FooClass
  198. */
  199. protected function getFooBarService()
  200. {
  201. return new \Bar\FooClass();
  202. }
  203. /**
  204. * Gets the public 'foo_with_inline' shared service.
  205. *
  206. * @return \Foo
  207. */
  208. protected function getFooWithInlineService()
  209. {
  210. $a = new \Bar();
  211. $this->services['foo_with_inline'] = $instance = new \Foo();
  212. $a->pub = 'pub';
  213. $a->setBaz(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->get('baz')) && false ?: '_'});
  214. $instance->setBar($a);
  215. return $instance;
  216. }
  217. /**
  218. * Gets the public 'lazy_context' shared service.
  219. *
  220. * @return \LazyContext
  221. */
  222. protected function getLazyContextService()
  223. {
  224. return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
  225. yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
  226. yield 'k2' => $this;
  227. }, 2), new RewindableGenerator(function () {
  228. return new \EmptyIterator();
  229. }, 0));
  230. }
  231. /**
  232. * Gets the public 'lazy_context_ignore_invalid_ref' shared service.
  233. *
  234. * @return \LazyContext
  235. */
  236. protected function getLazyContextIgnoreInvalidRefService()
  237. {
  238. return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () {
  239. yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->get('foo.baz')) && false ?: '_'};
  240. }, 1), new RewindableGenerator(function () {
  241. return new \EmptyIterator();
  242. }, 0));
  243. }
  244. /**
  245. * Gets the public 'method_call1' shared service.
  246. *
  247. * @return \Bar\FooClass
  248. */
  249. protected function getMethodCall1Service()
  250. {
  251. require_once '%path%foo.php';
  252. $this->services['method_call1'] = $instance = new \Bar\FooClass();
  253. $instance->setBar(${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->get('foo')) && false ?: '_'});
  254. $instance->setBar(NULL);
  255. $instance->setBar((${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->get('foo')) && false ?: '_'}->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
  256. return $instance;
  257. }
  258. /**
  259. * Gets the public 'new_factory_service' shared service.
  260. *
  261. * @return \FooBarBaz
  262. */
  263. protected function getNewFactoryServiceService()
  264. {
  265. $a = new \FactoryClass();
  266. $a->foo = 'bar';
  267. $this->services['new_factory_service'] = $instance = $a->getInstance();
  268. $instance->foo = 'bar';
  269. return $instance;
  270. }
  271. /**
  272. * Gets the public 'service_from_static_method' shared service.
  273. *
  274. * @return \Bar\FooClass
  275. */
  276. protected function getServiceFromStaticMethodService()
  277. {
  278. return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance();
  279. }
  280. /**
  281. * {@inheritdoc}
  282. */
  283. public function getParameter($name)
  284. {
  285. $name = strtolower($name);
  286. if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters) || isset($this->loadedDynamicParameters[$name]))) {
  287. throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
  288. }
  289. if (isset($this->loadedDynamicParameters[$name])) {
  290. return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
  291. }
  292. return $this->parameters[$name];
  293. }
  294. /**
  295. * {@inheritdoc}
  296. */
  297. public function hasParameter($name)
  298. {
  299. $name = strtolower($name);
  300. return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters) || isset($this->loadedDynamicParameters[$name]);
  301. }
  302. /**
  303. * {@inheritdoc}
  304. */
  305. public function setParameter($name, $value)
  306. {
  307. throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
  308. }
  309. /**
  310. * {@inheritdoc}
  311. */
  312. public function getParameterBag()
  313. {
  314. if (null === $this->parameterBag) {
  315. $parameters = $this->parameters;
  316. foreach ($this->loadedDynamicParameters as $name => $loaded) {
  317. $parameters[$name] = $loaded ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
  318. }
  319. $this->parameterBag = new FrozenParameterBag($parameters);
  320. }
  321. return $this->parameterBag;
  322. }
  323. private $loadedDynamicParameters = array();
  324. private $dynamicParameters = array();
  325. /**
  326. * Computes a dynamic parameter.
  327. *
  328. * @param string The name of the dynamic parameter to load
  329. *
  330. * @return mixed The value of the dynamic parameter
  331. *
  332. * @throws InvalidArgumentException When the dynamic parameter does not exist
  333. */
  334. private function getDynamicParameter($name)
  335. {
  336. throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
  337. }
  338. /**
  339. * Gets the default parameters.
  340. *
  341. * @return array An array of the default parameters
  342. */
  343. protected function getDefaultParameters()
  344. {
  345. return array(
  346. 'baz_class' => 'BazClass',
  347. 'foo_class' => 'Bar\\FooClass',
  348. 'foo' => 'bar',
  349. );
  350. }
  351. }