1af126fa3c961b4ae4cb523fab741f28d2e7c66f
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services9_compiled.php
1 <?php
2
3 use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
4 use Symfony\Component\DependencyInjection\ContainerInterface;
5 use Symfony\Component\DependencyInjection\Container;
6 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
7 use Symfony\Component\DependencyInjection\Exception\LogicException;
8 use Symfony\Component\DependencyInjection\Exception\RuntimeException;
9 use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
10
11 /**
12  * This class has been auto-generated
13  * by the Symfony Dependency Injection Component.
14  *
15  * @final since Symfony 3.3
16  */
17 class ProjectServiceContainer extends Container
18 {
19     private $parameters;
20     private $targetDirs = array();
21
22     public function __construct()
23     {
24         $this->parameters = $this->getDefaultParameters();
25
26         $this->services = array();
27         $this->syntheticIds = array(
28             'request' => true,
29         );
30         $this->methodMap = array(
31             'bar' => 'getBarService',
32             'baz' => 'getBazService',
33             'configured_service' => 'getConfiguredServiceService',
34             'configured_service_simple' => 'getConfiguredServiceSimpleService',
35             'decorator_service' => 'getDecoratorServiceService',
36             'decorator_service_with_name' => 'getDecoratorServiceWithNameService',
37             'deprecated_service' => 'getDeprecatedServiceService',
38             'factory_service' => 'getFactoryServiceService',
39             'factory_service_simple' => 'getFactoryServiceSimpleService',
40             'factory_simple' => 'getFactorySimpleService',
41             'foo' => 'getFooService',
42             'foo.baz' => 'getFoo_BazService',
43             'foo_bar' => 'getFooBarService',
44             'foo_with_inline' => 'getFooWithInlineService',
45             'lazy_context' => 'getLazyContextService',
46             'lazy_context_ignore_invalid_ref' => 'getLazyContextIgnoreInvalidRefService',
47             'method_call1' => 'getMethodCall1Service',
48             'new_factory_service' => 'getNewFactoryServiceService',
49             'service_from_static_method' => 'getServiceFromStaticMethodService',
50             'tagged_iterator' => 'getTaggedIteratorService',
51             'tagged_iterator_foo' => 'getTaggedIteratorFooService',
52         );
53         $this->privates = array(
54             'factory_simple' => true,
55             'tagged_iterator_foo' => true,
56         );
57         $this->aliases = array(
58             'alias_for_alias' => 'foo',
59             'alias_for_foo' => 'foo',
60             'decorated' => 'decorator_service_with_name',
61         );
62     }
63
64     public function getRemovedIds()
65     {
66         return array(
67             'Psr\\Container\\ContainerInterface' => true,
68             'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
69             'configurator_service' => true,
70             'configurator_service_simple' => true,
71             'decorated.pif-pouf' => true,
72             'decorator_service.inner' => true,
73             'factory_simple' => true,
74             'inlined' => true,
75             'new_factory' => true,
76             'tagged_iterator_foo' => true,
77         );
78     }
79
80     public function compile()
81     {
82         throw new LogicException('You cannot compile a dumped container that was already compiled.');
83     }
84
85     public function isCompiled()
86     {
87         return true;
88     }
89
90     public function isFrozen()
91     {
92         @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);
93
94         return true;
95     }
96
97     /**
98      * Gets the public 'bar' shared service.
99      *
100      * @return \Bar\FooClass
101      */
102     protected function getBarService()
103     {
104         $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'};
105
106         $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
107
108         $a->configure($instance);
109
110         return $instance;
111     }
112
113     /**
114      * Gets the public 'baz' shared service.
115      *
116      * @return \Baz
117      */
118     protected function getBazService()
119     {
120         $this->services['baz'] = $instance = new \Baz();
121
122         $instance->setFoo(${($_ = isset($this->services['foo_with_inline']) ? $this->services['foo_with_inline'] : $this->getFooWithInlineService()) && false ?: '_'});
123
124         return $instance;
125     }
126
127     /**
128      * Gets the public 'configured_service' shared service.
129      *
130      * @return \stdClass
131      */
132     protected function getConfiguredServiceService()
133     {
134         $this->services['configured_service'] = $instance = new \stdClass();
135
136         $a = new \ConfClass();
137         $a->setFoo(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->getBazService()) && false ?: '_'});
138
139         $a->configureStdClass($instance);
140
141         return $instance;
142     }
143
144     /**
145      * Gets the public 'configured_service_simple' shared service.
146      *
147      * @return \stdClass
148      */
149     protected function getConfiguredServiceSimpleService()
150     {
151         $this->services['configured_service_simple'] = $instance = new \stdClass();
152
153         (new \ConfClass('bar'))->configureStdClass($instance);
154
155         return $instance;
156     }
157
158     /**
159      * Gets the public 'decorator_service' shared service.
160      *
161      * @return \stdClass
162      */
163     protected function getDecoratorServiceService()
164     {
165         return $this->services['decorator_service'] = new \stdClass();
166     }
167
168     /**
169      * Gets the public 'decorator_service_with_name' shared service.
170      *
171      * @return \stdClass
172      */
173     protected function getDecoratorServiceWithNameService()
174     {
175         return $this->services['decorator_service_with_name'] = new \stdClass();
176     }
177
178     /**
179      * Gets the public 'deprecated_service' shared service.
180      *
181      * @return \stdClass
182      *
183      * @deprecated The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.
184      */
185     protected function getDeprecatedServiceService()
186     {
187         @trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.', E_USER_DEPRECATED);
188
189         return $this->services['deprecated_service'] = new \stdClass();
190     }
191
192     /**
193      * Gets the public 'factory_service' shared service.
194      *
195      * @return \Bar
196      */
197     protected function getFactoryServiceService()
198     {
199         return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}->getInstance();
200     }
201
202     /**
203      * Gets the public 'factory_service_simple' shared service.
204      *
205      * @return \Bar
206      */
207     protected function getFactoryServiceSimpleService()
208     {
209         return $this->services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->getFactorySimpleService()) && false ?: '_'}->getInstance();
210     }
211
212     /**
213      * Gets the public 'foo' shared service.
214      *
215      * @return \Bar\FooClass
216      */
217     protected function getFooService()
218     {
219         $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'};
220
221         $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
222
223         $instance->foo = 'bar';
224         $instance->moo = $a;
225         $instance->qux = array('bar' => 'foo is bar', 'foobar' => 'bar');
226         $instance->setBar(${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->getBarService()) && false ?: '_'});
227         $instance->initialize();
228         sc_configure($instance);
229
230         return $instance;
231     }
232
233     /**
234      * Gets the public 'foo.baz' shared service.
235      *
236      * @return \BazClass
237      */
238     protected function getFoo_BazService()
239     {
240         $this->services['foo.baz'] = $instance = \BazClass::getInstance();
241
242         \BazClass::configureStatic1($instance);
243
244         return $instance;
245     }
246
247     /**
248      * Gets the public 'foo_bar' service.
249      *
250      * @return \Bar\FooClass
251      */
252     protected function getFooBarService()
253     {
254         return new \Bar\FooClass(${($_ = isset($this->services['deprecated_service']) ? $this->services['deprecated_service'] : $this->getDeprecatedServiceService()) && false ?: '_'});
255     }
256
257     /**
258      * Gets the public 'foo_with_inline' shared service.
259      *
260      * @return \Foo
261      */
262     protected function getFooWithInlineService()
263     {
264         $this->services['foo_with_inline'] = $instance = new \Foo();
265
266         $a = new \Bar();
267
268         $a->pub = 'pub';
269         $a->setBaz(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->getBazService()) && false ?: '_'});
270
271         $instance->setBar($a);
272
273         return $instance;
274     }
275
276     /**
277      * Gets the public 'lazy_context' shared service.
278      *
279      * @return \LazyContext
280      */
281     protected function getLazyContextService()
282     {
283         return $this->services['lazy_context'] = new \LazyContext(new RewindableGenerator(function () {
284             yield 'k1' => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'};
285             yield 'k2' => $this;
286         }, 2), new RewindableGenerator(function () {
287             return new \EmptyIterator();
288         }, 0));
289     }
290
291     /**
292      * Gets the public 'lazy_context_ignore_invalid_ref' shared service.
293      *
294      * @return \LazyContext
295      */
296     protected function getLazyContextIgnoreInvalidRefService()
297     {
298         return $this->services['lazy_context_ignore_invalid_ref'] = new \LazyContext(new RewindableGenerator(function () {
299             yield 0 => ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'};
300         }, 1), new RewindableGenerator(function () {
301             return new \EmptyIterator();
302         }, 0));
303     }
304
305     /**
306      * Gets the public 'method_call1' shared service.
307      *
308      * @return \Bar\FooClass
309      */
310     protected function getMethodCall1Service()
311     {
312         include_once '%path%foo.php';
313
314         $this->services['method_call1'] = $instance = new \Bar\FooClass();
315
316         $instance->setBar(${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->getFooService()) && false ?: '_'});
317         $instance->setBar(NULL);
318         $instance->setBar((${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->getFooService()) && false ?: '_'}->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
319
320         return $instance;
321     }
322
323     /**
324      * Gets the public 'new_factory_service' shared service.
325      *
326      * @return \FooBarBaz
327      */
328     protected function getNewFactoryServiceService()
329     {
330         $a = new \FactoryClass();
331         $a->foo = 'bar';
332
333         $this->services['new_factory_service'] = $instance = $a->getInstance();
334
335         $instance->foo = 'bar';
336
337         return $instance;
338     }
339
340     /**
341      * Gets the public 'service_from_static_method' shared service.
342      *
343      * @return \Bar\FooClass
344      */
345     protected function getServiceFromStaticMethodService()
346     {
347         return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance();
348     }
349
350     /**
351      * Gets the public 'tagged_iterator' shared service.
352      *
353      * @return \Bar
354      */
355     protected function getTaggedIteratorService()
356     {
357         return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
358             yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->getFooService()) && false ?: '_'};
359             yield 1 => ${($_ = isset($this->services['tagged_iterator_foo']) ? $this->services['tagged_iterator_foo'] : $this->services['tagged_iterator_foo'] = new \Bar()) && false ?: '_'};
360         }, 2));
361     }
362
363     /**
364      * Gets the private 'factory_simple' shared service.
365      *
366      * @return \SimpleFactoryClass
367      *
368      * @deprecated The "factory_simple" service is deprecated. You should stop using it, as it will soon be removed.
369      */
370     protected function getFactorySimpleService()
371     {
372         @trigger_error('The "factory_simple" service is deprecated. You should stop using it, as it will soon be removed.', E_USER_DEPRECATED);
373
374         return $this->services['factory_simple'] = new \SimpleFactoryClass('foo');
375     }
376
377     /**
378      * Gets the private 'tagged_iterator_foo' shared service.
379      *
380      * @return \Bar
381      */
382     protected function getTaggedIteratorFooService()
383     {
384         return $this->services['tagged_iterator_foo'] = new \Bar();
385     }
386
387     public function getParameter($name)
388     {
389         $name = (string) $name;
390         if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
391             $name = $this->normalizeParameterName($name);
392
393             if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
394                 throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
395             }
396         }
397         if (isset($this->loadedDynamicParameters[$name])) {
398             return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
399         }
400
401         return $this->parameters[$name];
402     }
403
404     public function hasParameter($name)
405     {
406         $name = (string) $name;
407         $name = $this->normalizeParameterName($name);
408
409         return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
410     }
411
412     public function setParameter($name, $value)
413     {
414         throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
415     }
416
417     public function getParameterBag()
418     {
419         if (null === $this->parameterBag) {
420             $parameters = $this->parameters;
421             foreach ($this->loadedDynamicParameters as $name => $loaded) {
422                 $parameters[$name] = $loaded ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
423             }
424             $this->parameterBag = new FrozenParameterBag($parameters);
425         }
426
427         return $this->parameterBag;
428     }
429
430     private $loadedDynamicParameters = array();
431     private $dynamicParameters = array();
432
433     /**
434      * Computes a dynamic parameter.
435      *
436      * @param string The name of the dynamic parameter to load
437      *
438      * @return mixed The value of the dynamic parameter
439      *
440      * @throws InvalidArgumentException When the dynamic parameter does not exist
441      */
442     private function getDynamicParameter($name)
443     {
444         throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
445     }
446
447     private $normalizedParameterNames = array();
448
449     private function normalizeParameterName($name)
450     {
451         if (isset($this->normalizedParameterNames[$normalizedName = strtolower($name)]) || isset($this->parameters[$normalizedName]) || array_key_exists($normalizedName, $this->parameters)) {
452             $normalizedName = isset($this->normalizedParameterNames[$normalizedName]) ? $this->normalizedParameterNames[$normalizedName] : $normalizedName;
453             if ((string) $name !== $normalizedName) {
454                 @trigger_error(sprintf('Parameter names will be made case sensitive in Symfony 4.0. Using "%s" instead of "%s" is deprecated since Symfony 3.4.', $name, $normalizedName), E_USER_DEPRECATED);
455             }
456         } else {
457             $normalizedName = $this->normalizedParameterNames[$normalizedName] = (string) $name;
458         }
459
460         return $normalizedName;
461     }
462
463     /**
464      * Gets the default parameters.
465      *
466      * @return array An array of the default parameters
467      */
468     protected function getDefaultParameters()
469     {
470         return array(
471             'baz_class' => 'BazClass',
472             'foo_class' => 'Bar\\FooClass',
473             'foo' => 'bar',
474         );
475     }
476 }