|
| 1 | +<?php |
| 2 | + |
| 3 | +use Symfony\Component\DependencyInjection\ContainerInterface; |
| 4 | +use Symfony\Component\DependencyInjection\Container; |
| 5 | +use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; |
| 6 | +use Symfony\Component\DependencyInjection\Reference; |
| 7 | +use Symfony\Component\DependencyInjection\Parameter; |
| 8 | +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; |
| 9 | + |
| 10 | +/** |
| 11 | + * ProjectServiceContainer |
| 12 | + * |
| 13 | + * This class has been auto-generated |
| 14 | + * by the Symfony Dependency Injection Component. |
| 15 | + */ |
| 16 | +class ProjectServiceContainer extends Container |
| 17 | +{ |
| 18 | + /** |
| 19 | + * Constructor. |
| 20 | + */ |
| 21 | + public function __construct() |
| 22 | + { |
| 23 | + $this->parameters = $this->getDefaultParameters(); |
| 24 | + |
| 25 | + $this->services = |
| 26 | + $this->scopedServices = |
| 27 | + $this->scopeStacks = array(); |
| 28 | + |
| 29 | + $this->set('service_container', $this); |
| 30 | + |
| 31 | + $this->scopes = array(); |
| 32 | + $this->scopeChildren = array(); |
| 33 | + } |
| 34 | + |
| 35 | + /** |
| 36 | + * Gets the 'test' service. |
| 37 | + * |
| 38 | + * This service is shared. |
| 39 | + * This method always returns the same instance of the service. |
| 40 | + * |
| 41 | + * @return stdClass A stdClass instance. |
| 42 | + */ |
| 43 | + protected function getTestService() |
| 44 | + { |
| 45 | + 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')); |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * {@inheritdoc} |
| 50 | + */ |
| 51 | + public function getParameter($name) |
| 52 | + { |
| 53 | + $name = strtolower($name); |
| 54 | + |
| 55 | + if (!array_key_exists($name, $this->parameters)) { |
| 56 | + throw new \InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); |
| 57 | + } |
| 58 | + |
| 59 | + return $this->parameters[$name]; |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * {@inheritdoc} |
| 64 | + */ |
| 65 | + public function hasParameter($name) |
| 66 | + { |
| 67 | + return array_key_exists(strtolower($name), $this->parameters); |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * {@inheritdoc} |
| 72 | + */ |
| 73 | + public function setParameter($name, $value) |
| 74 | + { |
| 75 | + throw new \LogicException('Impossible to call set() on a frozen ParameterBag.'); |
| 76 | + } |
| 77 | + |
| 78 | + /** |
| 79 | + * {@inheritDoc} |
| 80 | + */ |
| 81 | + public function getParameterBag() |
| 82 | + { |
| 83 | + if (null === $this->parameterBag) { |
| 84 | + $this->parameterBag = new FrozenParameterBag($this->parameters); |
| 85 | + } |
| 86 | + |
| 87 | + return $this->parameterBag; |
| 88 | + } |
| 89 | + /** |
| 90 | + * Gets the default parameters. |
| 91 | + * |
| 92 | + * @return array An array of the default parameters |
| 93 | + */ |
| 94 | + protected function getDefaultParameters() |
| 95 | + { |
| 96 | + return array( |
| 97 | + 'empty_value' => '', |
| 98 | + 'some_string' => '-', |
| 99 | + ); |
| 100 | + } |
| 101 | +} |
0 commit comments