Completed
Push — master ( 481caa...7f6b38 )
by ARCANEDEV
02:50
created

FormRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
dl 0
loc 44
ccs 3
cts 7
cp 0.4286
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 4 1
rules() 0 1 ?
A prepareForValidation() 0 4 1
A sanitize() 0 6 1
1
<?php namespace Arcanedev\Support\Http;
2
3
use Illuminate\Foundation\Http\FormRequest as BaseFormRequest;
4
5
/**
6
 * Class     FormRequest
7
 *
8
 * @package  Arcanedev\Support
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
abstract class FormRequest extends BaseFormRequest
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Determine if the user is authorized to make this request.
20
     *
21
     * @return bool
22
     */
23
    public function authorize()
24
    {
25
        return false;
26
    }
27
28
    /**
29
     * Get the validation rules that apply to the request.
30
     *
31
     * @return array
32
     */
33
    abstract public function rules();
34
35
    /**
36
     * Prepare the data for validation.
37
     */
38 6
    protected function prepareForValidation()
39
    {
40 6
        $this->merge($this->sanitize());
41 6
    }
42
43
    /**
44
     * Sanitize the inputs after the validation.
45
     *
46
     * @return array
47
     */
48
    protected function sanitize()
49
    {
50
        return [
51
            //
52
        ];
53
    }
54
}
55