Passed
Push — dev ( d91619...3d1f41 )
by Nico
14:25
created

EditDetailsRequest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Test Coverage

Coverage 64.52%

Importance

Changes 0
Metric Value
eloc 27
c 0
b 0
f 0
dl 0
loc 69
ccs 20
cts 31
cp 0.6452
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getFactionMode() 0 4 1
A getRgbCode() 0 5 1
A getAcceptApplications() 0 4 1
A getHomepage() 0 5 1
A getDescription() 0 5 1
A getName() 0 5 1
A getSuccessorDescription() 0 5 1
A getDiplomaticDescription() 0 5 1
A getFounderDescription() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Alliance\Action\EditDetails;
6
7
use Override;
0 ignored issues
show
Bug introduced by
The type Override 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 Stu\Lib\Request\CustomControllerHelperTrait;
9
10
final class EditDetailsRequest implements EditDetailsRequestInterface
11
{
12
    use CustomControllerHelperTrait;
13
14 2
    #[Override]
15
    public function getName(): string
16
    {
17 2
        return $this->tidyString(
18 2
            $this->parameter('name')->string()->required()
19 2
        );
20
    }
21
22 2
    #[Override]
23
    public function getHomepage(): string
24
    {
25 2
        return $this->tidyString(
26 2
            $this->parameter('homepage')->string()->defaultsToIfEmpty('')
27 2
        );
28
    }
29
30 2
    #[Override]
31
    public function getDescription(): string
32
    {
33 2
        return $this->tidyString(
34 2
            $this->parameter('description')->string()->defaultsToIfEmpty('')
35 2
        );
36
    }
37
38 2
    #[Override]
39
    public function getFactionMode(): int
40
    {
41 2
        return $this->parameter('factionid')->int()->defaultsTo(0);
42
    }
43
44 2
    #[Override]
45
    public function getAcceptApplications(): int
46
    {
47 2
        return $this->parameter('acceptapp')->int()->defaultsTo(0);
48
    }
49
50 2
    #[Override]
51
    public function getRgbCode(): string
52
    {
53 2
        return $this->tidyString(
54 2
            $this->parameter('rgb')->string()->required()
55 2
        );
56
    }
57
58
    #[Override]
59
    public function getFounderDescription(): string
60
    {
61
        return $this->tidyString(
62
            $this->parameter('founder_description')->string()->defaultsToIfEmpty('Präsident')
63
        );
64
    }
65
66
    #[Override]
67
    public function getSuccessorDescription(): string
68
    {
69
        return $this->tidyString(
70
            $this->parameter('successor_description')->string()->defaultsToIfEmpty('Vize-Präsident')
71
        );
72
    }
73
74
    #[Override]
75
    public function getDiplomaticDescription(): string
76
    {
77
        return $this->tidyString(
78
            $this->parameter('diplomatic_description')->string()->defaultsToIfEmpty('Außenminister')
79
        );
80
    }
81
}
82