Passed
Pull Request — master (#572)
by Alexander
02:59 queued 01:28
created

Request   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRules() 0 8 1
A getPassword() 0 3 1
A getLogin() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infrastructure\IO\Http\Auth\PostLogin\Request;
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\Input\Http\Attribute\Parameter\Body;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Input\Http\Attribute\Parameter\Body 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\Input\Http\RequestInputInterface;
0 ignored issues
show
Bug introduced by
The type Yiisoft\Input\Http\RequestInputInterface 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\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...
11
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...
12
13
/**
14
 * @OA\Schema(
15
 *      schema="LoginRequest",
16
 *      @OA\Property(example="Opal1144", property="login", format="string"),
17
 *      @OA\Property(example="Opal1144", property="password", format="string"),
18
 * )
19
 */
20
final class Request implements RequestInputInterface, RulesProviderInterface
21
{
22
    #[Body('login')]
23
    private string $login = '';
24
25
    #[Body('password')]
26
    private string $password = '';
27
28
    public function getLogin(): string
29
    {
30
        return $this->login;
31
    }
32
33
    public function getPassword(): string
34
    {
35
        return $this->password;
36
    }
37
38
    public function getRules(): array
39
    {
40
        return [
41
            'login' => [
42
                new Required(),
43
            ],
44
            'password' => [
45
                new Required(),
46
            ],
47
        ];
48
    }
49
}
50