GetAuthenticatedUserRequest::authorize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\User\UI\API\Requests;
4
5
use App\Ship\Parents\Requests\Request;
6
7
/**
8
 * Class GetAuthenticatedUserRequest.
9
 */
10 View Code Duplication
class GetAuthenticatedUserRequest extends Request
0 ignored issues
show
Duplication introduced by Þorgrímur Jónasarson
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * Define which Roles and/or Permissions has access to this request.
14
     *
15
     * @var  array
16
     */
17
    protected $access = [
18
        'permissions' => '',
19
        'roles'       => '',
20
    ];
21
22
    /**
23
     * Id's that needs decoding before applying the validation rules.
24
     *
25
     * @var  array
26
     */
27
    protected $decode = [
28
        // 'id',
29
    ];
30
31
    /**
32
     * Defining the URL parameters (e.g, `/user/{id}`) allows applying
33
     * validation rules on them and allows accessing them like request data.
34
     *
35
     * @var  array
36
     */
37
    protected $urlParameters = [
38
        //'id',
39
    ];
40
41
    /**
42
     * @return  array
43
     */
44
    public function rules()
45
    {
46
        return [
47
            // put your rules here
48
            // 'name' => 'required|max:255'
49
        ];
50
    }
51
52
    /**
53
     * @return  bool
54
     */
55
    public function authorize()
56
    {
57
        return $this->check([
58
            'hasAccess',
59
        ]);
60
    }
61
}
62