Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 4.0047 |
Changes | 0 |
1 | <?php |
||
12 | 19 | public function findPermessoModuloOperatore(string $modulo, ?Operatori $operatore): ?Permessi |
|
13 | { |
||
14 | 19 | $em = $this->getEntityManager(); |
|
15 | 19 | if (!$operatore->getRuoli()) { |
|
|
|||
16 | return null; |
||
17 | } |
||
18 | 19 | $permesso = $em->getRepository(Permessi::class) |
|
19 | 19 | ->findOneBy(array('operatori_id' => $operatore->getId(), 'modulo' => $modulo)); |
|
20 | |||
21 | 19 | if (!$permesso) { |
|
22 | 18 | $permesso = $em |
|
23 | 18 | ->getRepository(Permessi::class) |
|
24 | 18 | ->findOneBy(array('ruoli_id' => $operatore->getRuoli()->getId(), 'modulo' => $modulo, 'operatori_id' => null)); |
|
25 | 18 | if (!$permesso) { |
|
26 | 18 | $permesso = $em |
|
27 | 18 | ->getRepository(Permessi::class) |
|
28 | 18 | ->findOneBy(array('ruoli_id' => null, 'modulo' => $modulo, 'operatori_id' => null)); |
|
29 | } |
||
30 | } |
||
31 | |||
32 | 19 | return $permesso; |
|
33 | } |
||
35 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.