5faa1a9781368544b894e53f2ade3380310e4baf
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services12.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         $dir = __DIR__;
28         for ($i = 1; $i <= 5; ++$i) {
29             $this->targetDirs[$i] = $dir = dirname($dir);
30         }
31         $this->parameters = $this->getDefaultParameters();
32
33         $this->services =
34         $this->scopedServices =
35         $this->scopeStacks = array();
36         $this->scopes = array();
37         $this->scopeChildren = array();
38         $this->methodMap = array(
39             'test' => 'getTestService',
40         );
41
42         $this->aliases = array();
43     }
44
45     /**
46      * {@inheritdoc}
47      */
48     public function compile()
49     {
50         throw new LogicException('You cannot compile a dumped frozen container.');
51     }
52
53     /**
54      * {@inheritdoc}
55      */
56     public function isFrozen()
57     {
58         return true;
59     }
60
61     /**
62      * Gets the 'test' service.
63      *
64      * This service is shared.
65      * This method always returns the same instance of the service.
66      *
67      * @return \stdClass A stdClass instance
68      */
69     protected function getTestService()
70     {
71         return $this->services['test'] = new \stdClass(('wiz'.$this->targetDirs[1]), array(('wiz'.$this->targetDirs[1]) => ($this->targetDirs[2].'/')));
72     }
73
74     /**
75      * {@inheritdoc}
76      */
77     public function getParameter($name)
78     {
79         $name = strtolower($name);
80
81         if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
82             throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
83         }
84
85         return $this->parameters[$name];
86     }
87
88     /**
89      * {@inheritdoc}
90      */
91     public function hasParameter($name)
92     {
93         $name = strtolower($name);
94
95         return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
96     }
97
98     /**
99      * {@inheritdoc}
100      */
101     public function setParameter($name, $value)
102     {
103         throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
104     }
105
106     /**
107      * {@inheritdoc}
108      */
109     public function getParameterBag()
110     {
111         if (null === $this->parameterBag) {
112             $this->parameterBag = new FrozenParameterBag($this->parameters);
113         }
114
115         return $this->parameterBag;
116     }
117
118     /**
119      * Gets the default parameters.
120      *
121      * @return array An array of the default parameters
122      */
123     protected function getDefaultParameters()
124     {
125         return array(
126             'foo' => ('wiz'.$this->targetDirs[1]),
127             'bar' => __DIR__,
128             'baz' => (__DIR__.'/PhpDumperTest.php'),
129             'buz' => $this->targetDirs[2],
130         );
131     }
132 }