Passed
Push — develop ( 4cbaa0...09ba9e )
by Ngoding
05:32
created

AbstractRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Http\Requests\User;
4
5
use App\Infrastructure\Foundation\Http\FormRequest;
6
7
abstract class AbstractRequest extends FormRequest
8
{
9
    /**
10
     * {@inheritDoc}
11
     */
12
    public function authorize()
13
    {
14
        return !is_null($this->user());
15
    }
16
17
    /**
18
     * {@inheritDoc}
19
     */
20 1
    public function attributes()
21
    {
22
        return [
23 1
            'username' => trans('Username'),
24 1
            'name' => trans('Name'),
25 1
            'email' => trans('Email'),
26 1
            'role' => trans('Role'),
27
        ];
28
    }
29
}
30