Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services10.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->methodMap = array(
28             'test' => 'getTestService',
29         );
30
31         $this->aliases = array();
32     }
33
34     public function getRemovedIds()
35     {
36         return array(
37             'Psr\\Container\\ContainerInterface' => true,
38             'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
39         );
40     }
41
42     public function compile()
43     {
44         throw new LogicException('You cannot compile a dumped container that was already compiled.');
45     }
46
47     public function isCompiled()
48     {
49         return true;
50     }
51
52     public function isFrozen()
53     {
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);
55
56         return true;
57     }
58
59     /**
60      * Gets the public 'test' shared service.
61      *
62      * @return \stdClass
63      */
64     protected function getTestService()
65     {
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'));
67     }
68
69     public function getParameter($name)
70     {
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);
74
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));
77             }
78         }
79         if (isset($this->loadedDynamicParameters[$name])) {
80             return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
81         }
82
83         return $this->parameters[$name];
84     }
85
86     public function hasParameter($name)
87     {
88         $name = (string) $name;
89         $name = $this->normalizeParameterName($name);
90
91         return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
92     }
93
94     public function setParameter($name, $value)
95     {
96         throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
97     }
98
99     public function getParameterBag()
100     {
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);
105             }
106             $this->parameterBag = new FrozenParameterBag($parameters);
107         }
108
109         return $this->parameterBag;
110     }
111
112     private $loadedDynamicParameters = array();
113     private $dynamicParameters = array();
114
115     /**
116      * Computes a dynamic parameter.
117      *
118      * @param string The name of the dynamic parameter to load
119      *
120      * @return mixed The value of the dynamic parameter
121      *
122      * @throws InvalidArgumentException When the dynamic parameter does not exist
123      */
124     private function getDynamicParameter($name)
125     {
126         throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
127     }
128
129     private $normalizedParameterNames = array();
130
131     private function normalizeParameterName($name)
132     {
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);
137             }
138         } else {
139             $normalizedName = $this->normalizedParameterNames[$normalizedName] = (string) $name;
140         }
141
142         return $normalizedName;
143     }
144
145     /**
146      * Gets the default parameters.
147      *
148      * @return array An array of the default parameters
149      */
150     protected function getDefaultParameters()
151     {
152         return array(
153             'empty_value' => '',
154             'some_string' => '-',
155         );
156     }
157 }