| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 71 | 10 | public function __invoke( $user_id, $role_id ) |
|
| 72 | { |
||
| 73 | |||
| 74 | 10 | $result = $this->stmt->execute([ |
|
| 75 | 10 | 'client_id' => $user_id, |
|
| 76 | 8 | 'role_id' => $role_id |
|
| 77 | 2 | ]); |
|
| 78 | |||
| 79 | // Evaluate |
||
| 80 | $loginfo = [ |
||
| 81 | 10 | 'user_id' => $user_id, |
|
| 82 | 10 | 'role_id' => $role_id, |
|
| 83 | 8 | 'result' => $result |
|
| 84 | 2 | ]; |
|
| 85 | |||
| 86 | 10 | if ($result): |
|
| 87 | 5 | $this->logger->info("Successfully assigned user to role.", $loginfo); |
|
| 88 | 1 | else: |
|
| 89 | 5 | $this->logger->warning("Could not assign user to role?!", $loginfo); |
|
| 90 | endif; |
||
| 91 | |||
| 92 | 10 | return $result; |
|
| 93 | } |
||
| 94 | } |
||
| 95 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..