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 | } |