Yaffs site version 1.1
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Fixtures / php / services10.php
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\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  * ProjectServiceContainer.
13  *
14  * This class has been auto-generated
15  * by the Symfony Dependency Injection Component.
16  */
17 class ProjectServiceContainer extends Container
18 {
19     private $parameters;
20     private $targetDirs = array();
21
22     /**
23      * Constructor.
24      */
25     public function __construct()
26     {
27         $this->parameters = $this->getDefaultParameters();
28
29         $this->services =
30         $this->scopedServices =
31         $this->scopeStacks = array();
32         $this->scopes = array();
33         $this->scopeChildren = array();
34         $this->methodMap = array(
35             'test' => 'getTestService',
36         );
37
38         $this->aliases = array();
39     }
40
41     /**
42      * {@inheritdoc}
43      */
44     public function compile()
45     {
46         throw new LogicException('You cannot compile a dumped frozen container.');
47     }
48
49     /**
50      * {@inheritdoc}
51      */
52     public function isFrozen()
53     {
54         return true;
55     }
56
57     /**
58      * Gets the 'test' service.
59      *
60      * This service is shared.
61      * This method always returns the same instance of the service.
62      *
63      * @return \stdClass A stdClass instance
64      */
65     protected function getTestService()
66     {
67         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'));
68     }
69
70     /**
71      * {@inheritdoc}
72      */
73     public function getParameter($name)
74     {
75         $name = strtolower($name);
76
77         if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
78             throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name));
79         }
80
81         return $this->parameters[$name];
82     }
83
84     /**
85      * {@inheritdoc}
86      */
87     public function hasParameter($name)
88     {
89         $name = strtolower($name);
90
91         return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
92     }
93
94     /**
95      * {@inheritdoc}
96      */
97     public function setParameter($name, $value)
98     {
99         throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
100     }
101
102     /**
103      * {@inheritdoc}
104      */
105     public function getParameterBag()
106     {
107         if (null === $this->parameterBag) {
108             $this->parameterBag = new FrozenParameterBag($this->parameters);
109         }
110
111         return $this->parameterBag;
112     }
113
114     /**
115      * Gets the default parameters.
116      *
117      * @return array An array of the default parameters
118      */
119     protected function getDefaultParameters()
120     {
121         return array(
122             'empty_value' => '',
123             'some_string' => '-',
124         );
125     }
126 }