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

PushController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 11
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A store() 0 9 1
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