Passed
Push — master ( 3a97d5...2b44a8 )
by Adam
21:57 queued 12s
created

PushController::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 9
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Coyote\Http\Controllers\User;
4
5
use Coyote\Http\Controllers\Controller;
6
use Illuminate\Http\Request;
7
8
class PushController extends Controller
9
{
10
    public function store(Request $request)
11
    {
12
        $this->validate($request, [
13
            'endpoint'    => 'required',
14
            'keys.auth'   => 'required',
15
            'keys.p256dh' => 'required'
16
        ]);
17
18
        $this->auth->updatePushSubscription($request->post('endpoint'), $request->input('keys.p256dh'), $request->input('keys.auth'));
0 ignored issues
show
Bug introduced by
It seems like $request->post('endpoint') can also be of type array; however, parameter $endpoint of Coyote\User::updatePushSubscription() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

18
        $this->auth->updatePushSubscription(/** @scrutinizer ignore-type */ $request->post('endpoint'), $request->input('keys.p256dh'), $request->input('keys.auth'));
Loading history...
19
    }
20
}
21