Completed
Push — develop ( d878ad...d28e4b )
by Abdelrahman
05:14
created

PhoneVerificationSendRequest::authorize()   D

Complexity

Conditions 10
Paths 6

Size

Total Lines 34
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 10
eloc 15
nc 6
nop 0
dl 0
loc 34
rs 4.8196
c 0
b 0
f 0

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Fort\Http\Requests\Tenantarea;
6
7
class PhoneVerificationSendRequest extends PhoneVerificationRequest
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
            'phone' => 'required|numeric|min:4|exists:'.config('rinvex.fort.tables.users').',phone',
18
        ];
19
    }
20
}
21