Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
8 / 8 |
|
90.91% |
10 / 11 |
|
50.00% |
5 / 10 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
| ComposedNick | |
100.00% |
8 / 8 |
|
90.91% |
10 / 11 |
|
50.00% |
5 / 10 |
|
100.00% |
5 / 5 |
10.50 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTargetGender | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTargetOffenseLevel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getWords | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getFinalLabel | |
100.00% |
4 / 4 |
|
85.71% |
6 / 7 |
|
16.67% |
1 / 6 |
|
100.00% |
1 / 1 |
4.31 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Dto\Result; |
| 4 | |
| 5 | use App\Enum\OffenseLevel; |
| 6 | use App\Enum\WordGender; |
| 7 | |
| 8 | /** |
| 9 | * @author Wilhelm Zwertvaegher |
| 10 | */ |
| 11 | readonly class ComposedNick |
| 12 | { |
| 13 | /** |
| 14 | * @param list<FormattedNickWord> $words |
| 15 | */ |
| 16 | public function __construct( |
| 17 | private WordGender $targetGender, |
| 18 | private OffenseLevel $targetOffenseLevel, |
| 19 | private array $words, |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function getTargetGender(): WordGender |
| 24 | { |
| 25 | return $this->targetGender; |
| 26 | } |
| 27 | |
| 28 | public function getTargetOffenseLevel(): OffenseLevel |
| 29 | { |
| 30 | return $this->targetOffenseLevel; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return list<FormattedNickWord> |
| 35 | */ |
| 36 | public function getWords(): array |
| 37 | { |
| 38 | return $this->words; |
| 39 | } |
| 40 | |
| 41 | public function getFinalLabel(): string |
| 42 | { |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 49 | } |
| 50 | } |
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.
| 16 | public function __construct( |
| 17 | private WordGender $targetGender, |
| 18 | private OffenseLevel $targetOffenseLevel, |
| 19 | private array $words, |
| 20 | ) { |
| 21 | } |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 49 | } |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 49 | } |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 49 | } |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 49 | } |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 49 | } |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 48 | return trim($finalLabel); |
| 49 | } |
| 25 | return $this->targetGender; |
| 26 | } |
| 30 | return $this->targetOffenseLevel; |
| 31 | } |
| 38 | return $this->words; |
| 39 | } |
| 3 | namespace App\Dto\Result; |
| 4 | |
| 5 | use App\Enum\OffenseLevel; |
| 6 | use App\Enum\WordGender; |
| 7 | |
| 8 | /** |
| 9 | * @author Wilhelm Zwertvaegher |
| 10 | */ |
| 11 | readonly class ComposedNick |
| 12 | { |
| 13 | /** |
| 14 | * @param list<FormattedNickWord> $words |
| 15 | */ |
| 16 | public function __construct( |
| 17 | private WordGender $targetGender, |
| 18 | private OffenseLevel $targetOffenseLevel, |
| 19 | private array $words, |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function getTargetGender(): WordGender |
| 24 | { |
| 25 | return $this->targetGender; |
| 26 | } |
| 27 | |
| 28 | public function getTargetOffenseLevel(): OffenseLevel |
| 29 | { |
| 30 | return $this->targetOffenseLevel; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return list<FormattedNickWord> |
| 35 | */ |
| 36 | public function getWords(): array |
| 37 | { |
| 38 | return $this->words; |
| 39 | } |
| 40 | |
| 41 | public function getFinalLabel(): string |
| 42 | { |
| 43 | $finalLabel = ''; |
| 44 | foreach ($this->words as $resultWord) { |
| 45 | $finalLabel .= $resultWord->label.$resultWord->separatorAfter; |
| 46 | } |
| 47 | |
| 48 | return trim($finalLabel); |
| 49 | } |