Total Complexity | 7 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class FiController extends AbstractController |
||
11 | { |
||
12 | use FiCoreControllerTrait, FiCoreCrudControllerTrait, FiCoreTabellaControllerTrait; |
||
|
|||
13 | |||
14 | protected $bundle; |
||
15 | protected $controller; |
||
16 | protected $permessi; |
||
17 | |||
18 | 17 | public function __construct(TokenStorageInterface $user, PermessiUtils $permessi) |
|
19 | { |
||
20 | 17 | $matches = array(); |
|
21 | 17 | $controllo = new \ReflectionClass(get_class($this)); |
|
22 | |||
23 | 17 | preg_match('/(.*)\\\(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
24 | 17 | if (count($matches) == 0) { |
|
25 | 10 | preg_match('/(.*)(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
26 | } |
||
27 | |||
28 | 17 | $this->bundle = ($matches[count($matches) - 2] ? $matches[count($matches) - 2] : $matches[count($matches) - 3]); |
|
29 | 17 | $this->controller = $matches[count($matches) - 1]; |
|
30 | 17 | $this->permessi = $permessi; |
|
31 | 17 | $this->user = $user; |
|
32 | 17 | } |
|
33 | 13 | protected function getBundle() |
|
36 | } |
||
37 | 17 | protected function getController() |
|
40 | } |
||
41 | 17 | protected function getPermessi() |
|
44 | } |
||
45 | 7 | protected function getUser() |
|
50 |