EmailVerificationProcessRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 9 1
A getRedirectUrl() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Auth\Http\Requests\Adminarea;
6
7
class EmailVerificationProcessRequest extends EmailVerificationRequest
8
{
9
    /**
10
     * Get the validation rules that apply to the request.
11
     *
12
     * @return array
13
     */
14
    public function rules(): array
15
    {
16
        return [
17
            // Do not validate `token` here since at this stage we can NOT generate viewable error,
18
            // and it is been processed in the controller through EmailVerificationBroker anyway
19
            //'token' => 'required|regex:/^([0-9a-f]*)$/',
20
            'email' => 'required|email|min:3|max:150|exists:'.config('cortex.auth.tables.admins').',email',
21
        ];
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function getRedirectUrl()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
28
    {
29
        return $this->redirector->getUrlGenerator()->route('adminarea.verification.email.request');
30
    }
31
}
32