Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
20 | 17 | public function __construct(PermessiManager $permessi, EngineInterface $template) |
|
21 | { |
||
22 | 17 | $matches = array(); |
|
23 | 17 | $controllo = new ReflectionClass(get_class($this)); |
|
24 | |||
25 | 17 | preg_match('/(.*)\\\(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
26 | 17 | if (0 == count($matches)) { |
|
27 | 10 | preg_match('/(.*)(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
28 | } |
||
29 | |||
30 | 17 | $this->bundle = ($matches[count($matches) - 2] ? $matches[count($matches) - 2] : $matches[count($matches) - 3]); |
|
31 | 17 | $this->controller = $matches[count($matches) - 1]; |
|
32 | 17 | $this->permessi = $permessi; |
|
33 | 17 | $this->template = $template; |
|
34 | 17 | } |
|
55 |