| Total Complexity | 7 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class FiController extends AbstractController |
||
| 12 | { |
||
| 13 | use FiCoreControllerTrait, FiCoreCrudControllerTrait, FiCoreTabellaControllerTrait; |
||
|
|
|||
| 14 | |||
| 15 | protected $bundle; |
||
| 16 | protected $template; |
||
| 17 | protected $controller; |
||
| 18 | 17 | protected $permessi; |
|
| 19 | |||
| 20 | 17 | public function __construct(PermessiManager $permessi, EngineInterface $template) |
|
| 21 | 17 | { |
|
| 22 | $matches = array(); |
||
| 23 | 17 | $controllo = new ReflectionClass(get_class($this)); |
|
| 24 | 17 | ||
| 25 | 10 | preg_match('/(.*)\\\(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
| 26 | if (0 == count($matches)) { |
||
| 27 | preg_match('/(.*)(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
||
| 28 | 17 | } |
|
| 29 | 17 | ||
| 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 | $this->permessi = $permessi; |
||
| 33 | 13 | $this->template = $template; |
|
| 34 | } |
||
| 35 | 13 | ||
| 36 | protected function getBundle() |
||
| 37 | { |
||
| 38 | 17 | return $this->bundle; |
|
| 39 | } |
||
| 40 | 17 | ||
| 41 | protected function getController() |
||
| 42 | { |
||
| 43 | 17 | return $this->controller; |
|
| 44 | } |
||
| 45 | 17 | ||
| 46 | protected function getPermessi() |
||
| 47 | { |
||
| 48 | return $this->permessi; |
||
| 49 | } |
||
| 50 | protected function getTemplate() |
||
| 53 | } |
||
| 54 | } |
||
| 55 |