Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services9.php
1 <?php
2
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\ParameterBag;
9
10 /**
11  * ProjectServiceContainer.
12  *
13  * This class has been auto-generated
14  * by the Symfony Dependency Injection Component.
15  */
16 class ProjectServiceContainer extends Container
17 {
18     private $parameters;
19     private $targetDirs = array();
20
21     /**
22      * Constructor.
23      */
24     public function __construct()
25     {
26         parent::__construct(new ParameterBag($this->getDefaultParameters()));
27         $this->methodMap = array(
28             'bar' => 'getBarService',
29             'baz' => 'getBazService',
30             'configurator_service' => 'getConfiguratorServiceService',
31             'configurator_service_simple' => 'getConfiguratorServiceSimpleService',
32             'configured_service' => 'getConfiguredServiceService',
33             'configured_service_simple' => 'getConfiguredServiceSimpleService',
34             'decorated' => 'getDecoratedService',
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             'inlined' => 'getInlinedService',
46             'method_call1' => 'getMethodCall1Service',
47             'new_factory' => 'getNewFactoryService',
48             'new_factory_service' => 'getNewFactoryServiceService',
49             'request' => 'getRequestService',
50             'service_from_static_method' => 'getServiceFromStaticMethodService',
51         );
52         $this->privates = array(
53             'configurator_service' => true,
54             'configurator_service_simple' => true,
55             'factory_simple' => true,
56             'inlined' => true,
57             'new_factory' => true,
58         );
59         $this->aliases = array(
60             'alias_for_alias' => 'foo',
61             'alias_for_foo' => 'foo',
62         );
63     }
64
65     /**
66      * Gets the public 'bar' shared service.
67      *
68      * @return \Bar\FooClass
69      */
70     protected function getBarService()
71     {
72         $a = $this->get('foo.baz');
73
74         $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar'));
75
76         $a->configure($instance);
77
78         return $instance;
79     }
80
81     /**
82      * Gets the public 'baz' shared service.
83      *
84      * @return \Baz
85      */
86     protected function getBazService()
87     {
88         $this->services['baz'] = $instance = new \Baz();
89
90         $instance->setFoo($this->get('foo_with_inline'));
91
92         return $instance;
93     }
94
95     /**
96      * Gets the public 'configured_service' shared service.
97      *
98      * @return \stdClass
99      */
100     protected function getConfiguredServiceService()
101     {
102         $this->services['configured_service'] = $instance = new \stdClass();
103
104         ${($_ = isset($this->services['configurator_service']) ? $this->services['configurator_service'] : $this->getConfiguratorServiceService()) && false ?: '_'}->configureStdClass($instance);
105
106         return $instance;
107     }
108
109     /**
110      * Gets the public 'configured_service_simple' shared service.
111      *
112      * @return \stdClass
113      */
114     protected function getConfiguredServiceSimpleService()
115     {
116         $this->services['configured_service_simple'] = $instance = new \stdClass();
117
118         ${($_ = isset($this->services['configurator_service_simple']) ? $this->services['configurator_service_simple'] : $this->getConfiguratorServiceSimpleService()) && false ?: '_'}->configureStdClass($instance);
119
120         return $instance;
121     }
122
123     /**
124      * Gets the public 'decorated' shared service.
125      *
126      * @return \stdClass
127      */
128     protected function getDecoratedService()
129     {
130         return $this->services['decorated'] = new \stdClass();
131     }
132
133     /**
134      * Gets the public 'decorator_service' shared service.
135      *
136      * @return \stdClass
137      */
138     protected function getDecoratorServiceService()
139     {
140         return $this->services['decorator_service'] = new \stdClass();
141     }
142
143     /**
144      * Gets the public 'decorator_service_with_name' shared service.
145      *
146      * @return \stdClass
147      */
148     protected function getDecoratorServiceWithNameService()
149     {
150         return $this->services['decorator_service_with_name'] = new \stdClass();
151     }
152
153     /**
154      * Gets the public 'deprecated_service' shared service.
155      *
156      * @return \stdClass
157      *
158      * @deprecated The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.
159      */
160     protected function getDeprecatedServiceService()
161     {
162         @trigger_error('The "deprecated_service" service is deprecated. You should stop using it, as it will soon be removed.', E_USER_DEPRECATED);
163
164         return $this->services['deprecated_service'] = new \stdClass();
165     }
166
167     /**
168      * Gets the public 'factory_service' shared service.
169      *
170      * @return \Bar
171      */
172     protected function getFactoryServiceService()
173     {
174         return $this->services['factory_service'] = $this->get('foo.baz')->getInstance();
175     }
176
177     /**
178      * Gets the public 'factory_service_simple' shared service.
179      *
180      * @return \Bar
181      */
182     protected function getFactoryServiceSimpleService()
183     {
184         return $this->services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->getFactorySimpleService()) && false ?: '_'}->getInstance();
185     }
186
187     /**
188      * Gets the public 'foo' shared service.
189      *
190      * @return \Bar\FooClass
191      */
192     protected function getFooService()
193     {
194         $a = $this->get('foo.baz');
195
196         $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo')), true, $this);
197
198         $instance->foo = 'bar';
199         $instance->moo = $a;
200         $instance->qux = array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo'));
201         $instance->setBar($this->get('bar'));
202         $instance->initialize();
203         sc_configure($instance);
204
205         return $instance;
206     }
207
208     /**
209      * Gets the public 'foo.baz' shared service.
210      *
211      * @return object A %baz_class% instance
212      */
213     protected function getFoo_BazService()
214     {
215         $this->services['foo.baz'] = $instance = call_user_func(array($this->getParameter('baz_class'), 'getInstance'));
216
217         call_user_func(array($this->getParameter('baz_class'), 'configureStatic1'), $instance);
218
219         return $instance;
220     }
221
222     /**
223      * Gets the public 'foo_bar' service.
224      *
225      * @return object A %foo_class% instance
226      */
227     protected function getFooBarService()
228     {
229         $class = $this->getParameter('foo_class');
230
231         return new $class();
232     }
233
234     /**
235      * Gets the public 'foo_with_inline' shared service.
236      *
237      * @return \Foo
238      */
239     protected function getFooWithInlineService()
240     {
241         $this->services['foo_with_inline'] = $instance = new \Foo();
242
243         $instance->setBar(${($_ = isset($this->services['inlined']) ? $this->services['inlined'] : $this->getInlinedService()) && false ?: '_'});
244
245         return $instance;
246     }
247
248     /**
249      * Gets the public 'method_call1' shared service.
250      *
251      * @return \Bar\FooClass
252      */
253     protected function getMethodCall1Service()
254     {
255         require_once '%path%foo.php';
256
257         $this->services['method_call1'] = $instance = new \Bar\FooClass();
258
259         $instance->setBar($this->get('foo'));
260         $instance->setBar($this->get('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE));
261         if ($this->has('foo3')) {
262             $instance->setBar($this->get('foo3', ContainerInterface::NULL_ON_INVALID_REFERENCE));
263         }
264         if ($this->has('foobaz')) {
265             $instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE));
266         }
267         $instance->setBar(($this->get('foo')->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
268
269         return $instance;
270     }
271
272     /**
273      * Gets the public 'new_factory_service' shared service.
274      *
275      * @return \FooBarBaz
276      */
277     protected function getNewFactoryServiceService()
278     {
279         $this->services['new_factory_service'] = $instance = ${($_ = isset($this->services['new_factory']) ? $this->services['new_factory'] : $this->getNewFactoryService()) && false ?: '_'}->getInstance();
280
281         $instance->foo = 'bar';
282
283         return $instance;
284     }
285
286     /**
287      * Gets the public 'request' shared service.
288      *
289      * @throws RuntimeException always since this service is expected to be injected dynamically
290      */
291     protected function getRequestService()
292     {
293         throw new RuntimeException('You have requested a synthetic service ("request"). The DIC does not know how to construct this service.');
294     }
295
296     /**
297      * Gets the public 'service_from_static_method' shared service.
298      *
299      * @return \Bar\FooClass
300      */
301     protected function getServiceFromStaticMethodService()
302     {
303         return $this->services['service_from_static_method'] = \Bar\FooClass::getInstance();
304     }
305
306     /**
307      * Gets the private 'configurator_service' shared service.
308      *
309      * @return \ConfClass
310      */
311     protected function getConfiguratorServiceService()
312     {
313         $this->services['configurator_service'] = $instance = new \ConfClass();
314
315         $instance->setFoo($this->get('baz'));
316
317         return $instance;
318     }
319
320     /**
321      * Gets the private 'configurator_service_simple' shared service.
322      *
323      * @return \ConfClass
324      */
325     protected function getConfiguratorServiceSimpleService()
326     {
327         return $this->services['configurator_service_simple'] = new \ConfClass('bar');
328     }
329
330     /**
331      * Gets the private 'factory_simple' shared service.
332      *
333      * @return \SimpleFactoryClass
334      */
335     protected function getFactorySimpleService()
336     {
337         return $this->services['factory_simple'] = new \SimpleFactoryClass('foo');
338     }
339
340     /**
341      * Gets the private 'inlined' shared service.
342      *
343      * @return \Bar
344      */
345     protected function getInlinedService()
346     {
347         $this->services['inlined'] = $instance = new \Bar();
348
349         $instance->pub = 'pub';
350         $instance->setBaz($this->get('baz'));
351
352         return $instance;
353     }
354
355     /**
356      * Gets the private 'new_factory' shared service.
357      *
358      * @return \FactoryClass
359      */
360     protected function getNewFactoryService()
361     {
362         $this->services['new_factory'] = $instance = new \FactoryClass();
363
364         $instance->foo = 'bar';
365
366         return $instance;
367     }
368
369     /**
370      * Gets the default parameters.
371      *
372      * @return array An array of the default parameters
373      */
374     protected function getDefaultParameters()
375     {
376         return array(
377             'baz_class' => 'BazClass',
378             'foo_class' => 'Bar\\FooClass',
379             'foo' => 'bar',
380         );
381     }
382 }