Issues (56)

Http/Controllers/ApiCompletedTasksController.php (1 issue)

Severity
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
The call to Illuminate\Foundation\Http\FormRequest::validate() has too many arguments starting with array('completed' => 'required'). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        $request->/** @scrutinizer ignore-call */ 
19
                  validate([

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.

Loading history...
19
        'completed' => 'required',
20
        ]);
21
22
        $task->completed = $request->completed;
23
        $task->save();
24
25
        return $task;
26
    }
27
}
28