Completed
Push — master ( 857394...4794c5 )
by Mahmoud
03:25
created

ConfirmUserEmailRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\Email\UI\API\Requests;
4
5
use App\Port\Request\Abstracts\Request;
6
7
/**
8
 * Class ConfirmUserEmailRequest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12 View Code Duplication
class ConfirmUserEmailRequest extends Request
0 ignored issues
show
Duplication introduced by
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...
13
{
14
15
    /**
16
     * Get the validation rules that apply to the request.
17
     *
18
     * @return array
19
     */
20
    public function rules()
21
    {
22
        return [
23
            'id'   => 'required|integer', // url parameter
24
            'code' => 'required|min:35|max:45', // url parameter
25
        ];
26
    }
27
28
    /**
29
     * Override the all() to automatically apply validation rules to the URL parameters
30
     *
31
     * @return  array
32
     */
33
    public function all()
34
    {
35
        $data = parent::all();
36
        $data['id'] = $this->route('id');
37
        $data['code'] = $this->route('code');
38
39
        return $data;
40
    }
41
42
    /**
43
     * Determine if the user is authorized to make this request.
44
     *
45
     * @return bool
46
     */
47
    public function authorize()
48
    {
49
        return true;
50
    }
51
}
52