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 Symfony_DI_PhpDumper_Test_Base64Parameters extends Container
20 private $targetDirs = array();
22 public function __construct()
24 $this->parameters = $this->getDefaultParameters();
26 $this->services = array();
28 $this->aliases = array();
31 public function getRemovedIds()
34 'Psr\\Container\\ContainerInterface' => true,
35 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
39 public function compile()
41 throw new LogicException('You cannot compile a dumped container that was already compiled.');
44 public function isCompiled()
49 public function isFrozen()
51 @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);
56 public function getParameter($name)
58 $name = (string) $name;
59 if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
60 $name = $this->normalizeParameterName($name);
62 if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters))) {
63 throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
66 if (isset($this->loadedDynamicParameters[$name])) {
67 return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
70 return $this->parameters[$name];
73 public function hasParameter($name)
75 $name = (string) $name;
76 $name = $this->normalizeParameterName($name);
78 return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters);
81 public function setParameter($name, $value)
83 throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
86 public function getParameterBag()
88 if (null === $this->parameterBag) {
89 $parameters = $this->parameters;
90 foreach ($this->loadedDynamicParameters as $name => $loaded) {
91 $parameters[$name] = $loaded ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
93 $this->parameterBag = new FrozenParameterBag($parameters);
96 return $this->parameterBag;
99 private $loadedDynamicParameters = array(
102 private $dynamicParameters = array();
105 * Computes a dynamic parameter.
107 * @param string The name of the dynamic parameter to load
109 * @return mixed The value of the dynamic parameter
111 * @throws InvalidArgumentException When the dynamic parameter does not exist
113 private function getDynamicParameter($name)
116 case 'hello': $value = $this->getEnv('base64:foo'); break;
117 default: throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
119 $this->loadedDynamicParameters[$name] = true;
121 return $this->dynamicParameters[$name] = $value;
124 private $normalizedParameterNames = array();
126 private function normalizeParameterName($name)
128 if (isset($this->normalizedParameterNames[$normalizedName = strtolower($name)]) || isset($this->parameters[$normalizedName]) || array_key_exists($normalizedName, $this->parameters)) {
129 $normalizedName = isset($this->normalizedParameterNames[$normalizedName]) ? $this->normalizedParameterNames[$normalizedName] : $normalizedName;
130 if ((string) $name !== $normalizedName) {
131 @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);
134 $normalizedName = $this->normalizedParameterNames[$normalizedName] = (string) $name;
137 return $normalizedName;
141 * Gets the default parameters.
143 * @return array An array of the default parameters
145 protected function getDefaultParameters()
148 'env(foo)' => 'd29ybGQ=',