Test Failed
Pull Request — master (#20)
by Alexander
04:17 queued 01:35
created

AuthRequest::getLogin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Auth;
6
7
use Yiisoft\RequestModel\RequestModel;
8
use Yiisoft\RequestModel\ValidatableModelInterface;
9
use Yiisoft\Validator\Rule\Required;
10
11
final class AuthRequest extends RequestModel implements ValidatableModelInterface
12
{
13
    public function getLogin(): string
14
    {
15
        return (string)$this->getValue('body.login');
16
    }
17
18
    public function getPassword(): string
19
    {
20
        return (string)$this->getValue('body.password');
21
    }
22
23
    public function getRules(): array
24
    {
25
        return [
26
            'body.login' => [
27
                new Required(),
28
            ],
29
            'body.password' => [
30
                new Required(),
31
            ],
32
        ];
33
    }
34
}
35