Added the Search API Synonym module to deal specifically with licence and license...
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services_env_in_id.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->normalizedIds = array(
28             'bar_%env(bar)%' => 'bar_%env(BAR)%',
29         );
30         $this->methodMap = array(
31             'bar' => 'getBarService',
32             'bar_%env(BAR)%' => 'getBarenvBARService',
33             'foo' => 'getFooService',
34         );
35         $this->privates = array(
36             'bar_%env(BAR)%' => true,
37         );
38
39         $this->aliases = array();
40     }
41
42     public function getRemovedIds()
43     {
44         return array(
45             'Psr\\Container\\ContainerInterface' => true,
46             'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
47             'bar_%env(BAR)%' => true,
48             'baz_%env(BAR)%' => true,
49         );
50     }
51
52     public function compile()
53     {
54         throw new LogicException('You cannot compile a dumped container that was already compiled.');
55     }
56
57     public function isCompiled()
58     {
59         return true;
60     }
61
62     public function isFrozen()
63     {
64         @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);
65
66         return true;
67     }
68
69     /**
70      * Gets the public 'bar' shared service.
71      *
72      * @return \stdClass
73      */
74     protected function getBarService()
75     {
76         return $this->services['bar'] = new \stdClass(${($_ = isset($this->services['bar_%env(BAR)%']) ? $this->services['bar_%env(BAR)%'] : $this->services['bar_%env(BAR)%'] = new \stdClass()) && false ?: '_'});
77     }
78
79     /**
80      * Gets the public 'foo' shared service.
81      *
82      * @return \stdClass
83      */
84     protected function getFooService()
85     {
86         return $this->services['foo'] = new \stdClass(${($_ = isset($this->services['bar_%env(BAR)%']) ? $this->services['bar_%env(BAR)%'] : $this->services['bar_%env(BAR)%'] = new \stdClass()) && false ?: '_'}, array('baz_'.$this->getEnv('string:BAR') => new \stdClass()));
87     }
88
89     /**
90      * Gets the private 'bar_%env(BAR)%' shared service.
91      *
92      * @return \stdClass
93      */
94     protected function getBarenvBARService()
95     {
96         return $this->services['bar_%env(BAR)%'] = new \stdClass();
97     }
98
99     public function getParameter($name)
100     {
101         $name = (string) $name;
102         if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
103             $name = $this->normalizeParameterName($name);
104
105             if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
106                 throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
107             }
108         }
109         if (isset($this->loadedDynamicParameters[$name])) {
110             return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
111         }
112
113         return $this->parameters[$name];
114     }
115
116     public function hasParameter($name)
117     {
118         $name = (string) $name;
119         $name = $this->normalizeParameterName($name);
120
121         return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
122     }
123
124     public function setParameter($name, $value)
125     {
126         throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
127     }
128
129     public function getParameterBag()
130     {
131         if (null === $this->parameterBag) {
132             $parameters = $this->parameters;
133             foreach ($this->loadedDynamicParameters as $name => $loaded) {
134                 $parameters[$name] = $loaded ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
135             }
136             $this->parameterBag = new FrozenParameterBag($parameters);
137         }
138
139         return $this->parameterBag;
140     }
141
142     private $loadedDynamicParameters = array();
143     private $dynamicParameters = array();
144
145     /**
146      * Computes a dynamic parameter.
147      *
148      * @param string The name of the dynamic parameter to load
149      *
150      * @return mixed The value of the dynamic parameter
151      *
152      * @throws InvalidArgumentException When the dynamic parameter does not exist
153      */
154     private function getDynamicParameter($name)
155     {
156         throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
157     }
158
159     private $normalizedParameterNames = array(
160         'env(bar)' => 'env(BAR)',
161     );
162
163     private function normalizeParameterName($name)
164     {
165         if (isset($this->normalizedParameterNames[$normalizedName = strtolower($name)]) || isset($this->parameters[$normalizedName]) || array_key_exists($normalizedName, $this->parameters)) {
166             $normalizedName = isset($this->normalizedParameterNames[$normalizedName]) ? $this->normalizedParameterNames[$normalizedName] : $normalizedName;
167             if ((string) $name !== $normalizedName) {
168                 @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);
169             }
170         } else {
171             $normalizedName = $this->normalizedParameterNames[$normalizedName] = (string) $name;
172         }
173
174         return $normalizedName;
175     }
176
177     /**
178      * Gets the default parameters.
179      *
180      * @return array An array of the default parameters
181      */
182     protected function getDefaultParameters()
183     {
184         return array(
185             'env(BAR)' => 'bar',
186         );
187     }
188 }