Conditions | 7 |
Paths | 7 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function resolve($reference) |
||
27 | { |
||
28 | if (!is_string($reference)) { |
||
29 | return $reference; |
||
30 | } |
||
31 | $prefix = substr($reference, 0, 1); |
||
32 | |||
33 | switch (1) { |
||
34 | case $prefix === '@' : return $this->container->get(substr($reference, 1)); |
||
35 | case $prefix === '%' : return $this->container->getParameter(substr($reference, 1)); |
||
36 | case preg_match(static::CONTAINER_REGEXP, $reference, $matches) : return $this->container; |
||
37 | case preg_match(static::ENVIRONMENT_REGEXP, $reference, $matches) : return getenv($matches[1]); |
||
38 | case preg_match(static::CONSTANT_REGEXP, $reference, $matches) : return constant($matches[1]); |
||
39 | default : return $reference; |
||
40 | } |
||
41 | } |
||
42 | |||
55 |
As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.