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->methodMap = array(
28 'test' => 'getTestService',
31 $this->aliases = array();
34 public function getRemovedIds()
37 'Psr\\Container\\ContainerInterface' => true,
38 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
42 public function compile()
44 throw new LogicException('You cannot compile a dumped container that was already compiled.');
47 public function isCompiled()
52 public function isFrozen()
54 @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);
60 * Gets the public 'test' shared service.
64 protected function getTestService()
66 return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end', 'new line' => 'string with '."\n".'new line'));
69 public function getParameter($name)
71 $name = (string) $name;
72 if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
73 $name = $this->normalizeParameterName($name);
75 if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
76 throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
79 if (isset($this->loadedDynamicParameters[$name])) {
80 return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
83 return $this->parameters[$name];
86 public function hasParameter($name)
88 $name = (string) $name;
89 $name = $this->normalizeParameterName($name);
91 return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
94 public function setParameter($name, $value)
96 throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
99 public function getParameterBag()
101 if (null === $this->parameterBag) {
102 $parameters = $this->parameters;
103 foreach ($this->loadedDynamicParameters as $name => $loaded) {
104 $parameters[$name] = $loaded ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
106 $this->parameterBag = new FrozenParameterBag($parameters);
109 return $this->parameterBag;
112 private $loadedDynamicParameters = array();
113 private $dynamicParameters = array();
116 * Computes a dynamic parameter.
118 * @param string The name of the dynamic parameter to load
120 * @return mixed The value of the dynamic parameter
122 * @throws InvalidArgumentException When the dynamic parameter does not exist
124 private function getDynamicParameter($name)
126 throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
129 private $normalizedParameterNames = array();
131 private function normalizeParameterName($name)
133 if (isset($this->normalizedParameterNames[$normalizedName = strtolower($name)]) || isset($this->parameters[$normalizedName]) || array_key_exists($normalizedName, $this->parameters)) {
134 $normalizedName = isset($this->normalizedParameterNames[$normalizedName]) ? $this->normalizedParameterNames[$normalizedName] : $normalizedName;
135 if ((string) $name !== $normalizedName) {
136 @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);
139 $normalizedName = $this->normalizedParameterNames[$normalizedName] = (string) $name;
142 return $normalizedName;
146 * Gets the default parameters.
148 * @return array An array of the default parameters
150 protected function getDefaultParameters()
154 'some_string' => '-',