Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
| RandomWordRequest | |
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPreviousId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getGrammaticalRoleType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getGender | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getOffenseLevel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getExclusions | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Dto\Request; |
| 4 | |
| 5 | use App\Enum\GrammaticalRoleType; |
| 6 | use App\Enum\OffenseLevel; |
| 7 | use App\Enum\WordGender; |
| 8 | use App\Exception\ValidationErrorMessage; |
| 9 | use Symfony\Component\Validator\Constraints as Assert; |
| 10 | |
| 11 | /** |
| 12 | * @author Wilhelm Zwertvaegher |
| 13 | * Parameters for word retrieval (i.e. replace a word in a generated nick) |
| 14 | * - Lang |
| 15 | * - WordType |
| 16 | * - OffenseLevel (maybe null) |
| 17 | * - WordGender (maybe null) |
| 18 | * - exclusions : a list a word ids to exclude |
| 19 | */ |
| 20 | class RandomWordRequest implements Request |
| 21 | { |
| 22 | /** |
| 23 | * @param list<int> $exclusions |
| 24 | */ |
| 25 | public function __construct( |
| 26 | #[Assert\Type('integer', message: ValidationErrorMessage::INVALID_FIELD_VALUE)] |
| 27 | private int $previousId, |
| 28 | private GrammaticalRoleType $role, |
| 29 | private WordGender $gender, |
| 30 | private OffenseLevel $offenseLevel = OffenseLevel::MEDIUM, |
| 31 | private array $exclusions = [], |
| 32 | ) { |
| 33 | } |
| 34 | |
| 35 | public function getPreviousId(): int |
| 36 | { |
| 37 | return $this->previousId; |
| 38 | } |
| 39 | |
| 40 | public function getGrammaticalRoleType(): GrammaticalRoleType |
| 41 | { |
| 42 | return $this->role; |
| 43 | } |
| 44 | |
| 45 | public function getGender(): ?WordGender |
| 46 | { |
| 47 | return $this->gender; |
| 48 | } |
| 49 | |
| 50 | public function getOffenseLevel(): ?OffenseLevel |
| 51 | { |
| 52 | return $this->offenseLevel; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * @return list<int> |
| 57 | */ |
| 58 | public function getExclusions(): array |
| 59 | { |
| 60 | return $this->exclusions; |
| 61 | } |
| 62 | } |
Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not
necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once.
Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 25 | public function __construct( |
| 26 | #[Assert\Type('integer', message: ValidationErrorMessage::INVALID_FIELD_VALUE)] |
| 27 | private int $previousId, |
| 28 | private GrammaticalRoleType $role, |
| 29 | private WordGender $gender, |
| 30 | private OffenseLevel $offenseLevel = OffenseLevel::MEDIUM, |
| 31 | private array $exclusions = [], |
| 32 | ) { |
| 33 | } |
| 60 | return $this->exclusions; |
| 61 | } |
| 47 | return $this->gender; |
| 48 | } |
| 42 | return $this->role; |
| 43 | } |
| 52 | return $this->offenseLevel; |
| 53 | } |
| 37 | return $this->previousId; |
| 38 | } |
| 3 | namespace App\Dto\Request; |
| 4 | |
| 5 | use App\Enum\GrammaticalRoleType; |
| 6 | use App\Enum\OffenseLevel; |
| 7 | use App\Enum\WordGender; |
| 8 | use App\Exception\ValidationErrorMessage; |
| 9 | use Symfony\Component\Validator\Constraints as Assert; |
| 10 | |
| 11 | /** |
| 12 | * @author Wilhelm Zwertvaegher |
| 13 | * Parameters for word retrieval (i.e. replace a word in a generated nick) |
| 14 | * - Lang |
| 15 | * - WordType |
| 16 | * - OffenseLevel (maybe null) |
| 17 | * - WordGender (maybe null) |
| 18 | * - exclusions : a list a word ids to exclude |
| 19 | */ |
| 20 | class RandomWordRequest implements Request |
| 21 | { |
| 22 | /** |
| 23 | * @param list<int> $exclusions |
| 24 | */ |
| 25 | public function __construct( |
| 26 | #[Assert\Type('integer', message: ValidationErrorMessage::INVALID_FIELD_VALUE)] |
| 27 | private int $previousId, |
| 28 | private GrammaticalRoleType $role, |
| 29 | private WordGender $gender, |
| 30 | private OffenseLevel $offenseLevel = OffenseLevel::MEDIUM, |
| 31 | private array $exclusions = [], |
| 32 | ) { |
| 33 | } |
| 34 | |
| 35 | public function getPreviousId(): int |
| 36 | { |
| 37 | return $this->previousId; |
| 38 | } |
| 39 | |
| 40 | public function getGrammaticalRoleType(): GrammaticalRoleType |
| 41 | { |
| 42 | return $this->role; |
| 43 | } |
| 44 | |
| 45 | public function getGender(): ?WordGender |
| 46 | { |
| 47 | return $this->gender; |
| 48 | } |
| 49 | |
| 50 | public function getOffenseLevel(): ?OffenseLevel |
| 51 | { |
| 52 | return $this->offenseLevel; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * @return list<int> |
| 57 | */ |
| 58 | public function getExclusions(): array |
| 59 | { |
| 60 | return $this->exclusions; |
| 61 | } |