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

AbstractRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
ccs 5
cts 7
cp 0.7143
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 3 1
A attributes() 0 7 1
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