Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
12 | 6 | public function __construct(ObjectManager $em, TokenStorageInterface $user) |
|
13 | { |
||
14 | 6 | $matches = array(); |
|
|
|||
15 | 6 | $controllo = new \ReflectionClass(get_class($this)); |
|
16 | |||
17 | 6 | preg_match('/(.*)\\\(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
18 | 6 | if (count($matches) == 0) { |
|
19 | 1 | preg_match('/(.*)(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
|
20 | } |
||
21 | |||
22 | 6 | $this->bundle = ($matches[count($matches) - 2] ? $matches[count($matches) - 2] : $matches[count($matches) - 3]); |
|
23 | 6 | $this->controller = $matches[count($matches) - 1]; |
|
24 | 6 | $this->permessi = new PermessiUtils($em, $this->getController(), $user->getToken()->getUser()); |
|
25 | 6 | } |
|
27 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.