Completed
Push — master ( 1c99c3...427db9 )
by Abdelrahman
02:46
created

EmailVerificationRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
namespace Rinvex\Fort\Http\Requests\Frontend;
17
18
use Rinvex\Support\Http\Requests\FormRequest;
19
20
class EmailVerificationRequest extends FormRequest
21
{
22
    /**
23
     * Determine if the user is authorized to make this request.
24
     *
25
     * @return bool
26
     */
27
    public function authorize()
28
    {
29
        return true;
30
    }
31
32
    /**
33
     * Get the validation rules that apply to the request.
34
     *
35
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
36
     */
37
    public function rules()
38
    {
39
        return $this->isMethod('post') ? [
40
            'email' => 'required|email|max:255',
41
        ] : [
42
            'email' => 'required|email|max:255',
43
            'token' => 'required|regex:/^[0-9a-zA-Z]+$/',
44
        ];
45
    }
46
}
47