Completed
Push — master ( a9e84e...dd9350 )
by Quim González
07:11
created

ApiCompletedTasksController::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Http\Requests\StoreTask;
6
use App\Task;
7
use Illuminate\Http\Request;
8
9
class ApiCompletedTasksController extends Controller
10
{
11
    /**
12
     * @param StoreTask $request
13
     * @return mixed
14
     */
15
    public function store(StoreTask $request)
16
    {
17
        $request->validate([
0 ignored issues
show
Unused Code introduced by
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

17
        $request->/** @scrutinizer ignore-call */ 
18
                  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...
18
            'completed' => 'required',
19
        ]);
20
21
        $task = Task::create($request->only([ 'completed']));
22
23
        return $task;
24
    }
25
}
26