| Conditions | 4 |
| Paths | 8 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function run($user, $rolesIds) |
||
| 26 | { |
||
| 27 | if (!$user instanceof User) { |
||
| 28 | $user = $this->call(FindUserByIdTask::class, [$user]); |
||
| 29 | } |
||
| 30 | |||
| 31 | if (!is_array($rolesIds)) { |
||
| 32 | $rolesIds = [$rolesIds]; |
||
| 33 | } |
||
| 34 | |||
| 35 | $roles = new Collection(); |
||
| 36 | |||
| 37 | foreach ($rolesIds as $roleId) { |
||
| 38 | $role = $this->call(GetRoleTask::class, [$roleId]); |
||
| 39 | $roles->add($role); |
||
| 40 | } |
||
| 41 | |||
| 42 | return $this->call(revokeUserFromRoleTask::class, [$user, $roles->pluck('name')->toArray()]); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.