Passed
Pull Request — master (#545)
by Dmitriy
11:54 queued 10:23
created

AuthRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPassword() 0 3 1
A getRules() 0 8 1
A getLogin() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Auth;
6
7
use OpenApi\Annotations as OA;
0 ignored issues
show
Bug introduced by
The type OpenApi\Annotations was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Yiisoft\RequestModel\RequestModel;
0 ignored issues
show
Bug introduced by
The type Yiisoft\RequestModel\RequestModel was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Yiisoft\Validator\Rule\Required;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Validator\Rule\Required was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Yiisoft\Validator\RulesProviderInterface;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Validator\RulesProviderInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
/**
13
 * @OA\Schema(
14
 *      schema="AuthRequest",
15
 *      @OA\Property(example="Opal1144", property="login", format="string"),
16
 *      @OA\Property(example="Opal1144", property="password", format="string"),
17
 * )
18
 */
19
final class AuthRequest extends RequestModel implements RulesProviderInterface
20
{
21
    public function getLogin(): string
22
    {
23
        return (string) $this->getAttributeValue('body.login');
24
    }
25
26
    public function getPassword(): string
27
    {
28
        return (string) $this->getAttributeValue('body.password');
29
    }
30
31
    public function getRules(): array
32
    {
33
        return [
34
            'body.login' => [
35
                new Required(),
36
            ],
37
            'body.password' => [
38
                new Required(),
39
            ],
40
        ];
41
    }
42
}
43