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 |
| ValueCriterion | |
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 | |||
| getField | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getValue | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCheck | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| shouldApply | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTargetEntity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Specification\Criterion; |
| 4 | |
| 5 | use App\Entity\GrammaticalRole; |
| 6 | use App\Entity\Word; |
| 7 | |
| 8 | /** |
| 9 | * @author Wilhelm Zwertvaegher |
| 10 | */ |
| 11 | class ValueCriterion implements Criterion |
| 12 | { |
| 13 | /** |
| 14 | * @param class-string<Word|GrammaticalRole> $targetEntity |
| 15 | */ |
| 16 | public function __construct( |
| 17 | private readonly string $targetEntity, |
| 18 | private readonly string $field, |
| 19 | private readonly mixed $value, |
| 20 | private readonly ValueCriterionCheck $check, |
| 21 | ) { |
| 22 | } |
| 23 | |
| 24 | public function getField(): string |
| 25 | { |
| 26 | return $this->field; |
| 27 | } |
| 28 | |
| 29 | public function getValue(): mixed |
| 30 | { |
| 31 | return $this->value; |
| 32 | } |
| 33 | |
| 34 | public function getCheck(): ValueCriterionCheck |
| 35 | { |
| 36 | return $this->check; |
| 37 | } |
| 38 | |
| 39 | public function shouldApply(): bool |
| 40 | { |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | public function getTargetEntity(): string |
| 45 | { |
| 46 | return $this->targetEntity; |
| 47 | } |
| 48 | } |
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 readonly string $targetEntity, |
| 18 | private readonly string $field, |
| 19 | private readonly mixed $value, |
| 20 | private readonly ValueCriterionCheck $check, |
| 21 | ) { |
| 22 | } |
| 36 | return $this->check; |
| 37 | } |
| 26 | return $this->field; |
| 27 | } |
| 46 | return $this->targetEntity; |
| 47 | } |
| 31 | return $this->value; |
| 32 | } |
| 41 | return true; |
| 42 | } |