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;
12 * This class has been auto-generated
13 * by the Symfony Dependency Injection Component.
15 * @final since Symfony 3.3
17 class ProjectServiceContainer extends Container
20 private $targetDirs = array();
22 public function __construct()
24 $this->parameters = $this->getDefaultParameters();
26 $this->services = array();
27 $this->normalizedIds = array(
28 'bar_%env(bar)%' => 'bar_%env(BAR)%',
30 $this->methodMap = array(
31 'bar' => 'getBarService',
32 'bar_%env(BAR)%' => 'getBarenvBARService',
33 'foo' => 'getFooService',
35 $this->privates = array(
36 'bar_%env(BAR)%' => true,
39 $this->aliases = array();
42 public function getRemovedIds()
45 'Psr\\Container\\ContainerInterface' => true,
46 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
47 'bar_%env(BAR)%' => true,
48 'baz_%env(BAR)%' => true,
52 public function compile()
54 throw new LogicException('You cannot compile a dumped container that was already compiled.');
57 public function isCompiled()
62 public function isFrozen()
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);
70 * Gets the public 'bar' shared service.
74 protected function getBarService()
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 ?: '_'});
80 * Gets the public 'foo' shared service.
84 protected function getFooService()
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()));
90 * Gets the private 'bar_%env(BAR)%' shared service.
94 protected function getBarenvBARService()
96 return $this->services['bar_%env(BAR)%'] = new \stdClass();
99 public function getParameter($name)
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);
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));
109 if (isset($this->loadedDynamicParameters[$name])) {
110 return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
113 return $this->parameters[$name];
116 public function hasParameter($name)
118 $name = (string) $name;
119 $name = $this->normalizeParameterName($name);
121 return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
124 public function setParameter($name, $value)
126 throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
129 public function getParameterBag()
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);
136 $this->parameterBag = new FrozenParameterBag($parameters);
139 return $this->parameterBag;
142 private $loadedDynamicParameters = array();
143 private $dynamicParameters = array();
146 * Computes a dynamic parameter.
148 * @param string The name of the dynamic parameter to load
150 * @return mixed The value of the dynamic parameter
152 * @throws InvalidArgumentException When the dynamic parameter does not exist
154 private function getDynamicParameter($name)
156 throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
159 private $normalizedParameterNames = array(
160 'env(bar)' => 'env(BAR)',
163 private function normalizeParameterName($name)
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);
171 $normalizedName = $this->normalizedParameterNames[$normalizedName] = (string) $name;
174 return $normalizedName;
178 * Gets the default parameters.
180 * @return array An array of the default parameters
182 protected function getDefaultParameters()