quimgc /
Tasks
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Http\Controllers; |
||
| 4 | |||
| 5 | use App\Http\Requests\StoreTask; |
||
| 6 | use App\Http\Requests\UpdateCompletedTask; |
||
| 7 | use App\Task; |
||
| 8 | |||
| 9 | class ApiCompletedTasksController extends Controller |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param StoreTask $request |
||
| 13 | * |
||
| 14 | * @return mixed |
||
| 15 | */ |
||
| 16 | public function update(UpdateCompletedTask $request, Task $task) |
||
| 17 | { |
||
| 18 | $request->validate([ |
||
|
0 ignored issues
–
show
|
|||
| 19 | 'completed' => 'required', |
||
| 20 | ]); |
||
| 21 | |||
| 22 | $task->completed = $request->completed; |
||
| 23 | $task->save(); |
||
| 24 | |||
| 25 | return $task; |
||
| 26 | } |
||
| 27 | } |
||
| 28 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.