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