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