985f0a96283d5d3f56af163ca2223b0d9bdd20ff
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services19.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\ParameterBag;
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         parent::__construct();
28         $this->methodMap = array(
29             'service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService',
30             'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService',
31         );
32     }
33
34     /**
35      * Gets the 'service_from_anonymous_factory' service.
36      *
37      * This service is shared.
38      * This method always returns the same instance of the service.
39      *
40      * @return \Bar\FooClass A Bar\FooClass instance
41      */
42     protected function getServiceFromAnonymousFactoryService()
43     {
44         return $this->services['service_from_anonymous_factory'] = call_user_func(array(new \Bar\FooClass(), 'getInstance'));
45     }
46
47     /**
48      * Gets the 'service_with_method_call_and_factory' service.
49      *
50      * This service is shared.
51      * This method always returns the same instance of the service.
52      *
53      * @return \Bar\FooClass A Bar\FooClass instance
54      */
55     protected function getServiceWithMethodCallAndFactoryService()
56     {
57         $this->services['service_with_method_call_and_factory'] = $instance = new \Bar\FooClass();
58
59         $instance->setBar(\Bar\FooClass::getInstance());
60
61         return $instance;
62     }
63 }