3 use Symfony\Component\DependencyInjection\ContainerInterface;
4 use Symfony\Component\DependencyInjection\Container;
5 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
6 use Symfony\Component\DependencyInjection\Exception\LogicException;
7 use Symfony\Component\DependencyInjection\Exception\RuntimeException;
8 use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
11 * ProjectServiceContainer.
13 * This class has been auto-generated
14 * by the Symfony Dependency Injection Component.
16 class ProjectServiceContainer extends Container
19 private $targetDirs = array();
24 public function __construct()
26 $this->parameters = $this->getDefaultParameters();
28 $this->services = array();
29 $this->methodMap = array(
30 'test' => 'getTestService',
33 $this->aliases = array();
39 public function compile()
41 throw new LogicException('You cannot compile a dumped frozen container.');
47 public function isFrozen()
53 * Gets the public 'test' shared service.
57 protected function getTestService()
59 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'));
65 public function getParameter($name)
67 $name = strtolower($name);
69 if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters) || isset($this->loadedDynamicParameters[$name]))) {
70 throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
72 if (isset($this->loadedDynamicParameters[$name])) {
73 return $this->loadedDynamicParameters[$name] ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
76 return $this->parameters[$name];
82 public function hasParameter($name)
84 $name = strtolower($name);
86 return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters) || isset($this->loadedDynamicParameters[$name]);
92 public function setParameter($name, $value)
94 throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
100 public function getParameterBag()
102 if (null === $this->parameterBag) {
103 $parameters = $this->parameters;
104 foreach ($this->loadedDynamicParameters as $name => $loaded) {
105 $parameters[$name] = $loaded ? $this->dynamicParameters[$name] : $this->getDynamicParameter($name);
107 $this->parameterBag = new FrozenParameterBag($parameters);
110 return $this->parameterBag;
113 private $loadedDynamicParameters = array();
114 private $dynamicParameters = array();
117 * Computes a dynamic parameter.
119 * @param string The name of the dynamic parameter to load
121 * @return mixed The value of the dynamic parameter
123 * @throws InvalidArgumentException When the dynamic parameter does not exist
125 private function getDynamicParameter($name)
127 throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name));
131 * Gets the default parameters.
133 * @return array An array of the default parameters
135 protected function getDefaultParameters()
139 'some_string' => '-',