Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ValTesterTrait | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| getValueTester | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setValueTester | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| testValue | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace pvc\struct\types\value; |
| 4 | |
| 5 | |
| 6 | use pvc\interfaces\struct\types\value\ValTesterInterface; |
| 7 | |
| 8 | trait ValTesterTrait |
| 9 | { |
| 10 | public ValTesterInterface $valueTester; |
| 11 | |
| 12 | protected function getValueTester(): ?ValTesterInterface |
| 13 | { |
| 14 | return $this->valueTester ?? null; |
| 15 | } |
| 16 | |
| 17 | public function setValueTester(ValTesterInterface $valueTester): void |
| 18 | { |
| 19 | $this->valueTester = $valueTester; |
| 20 | } |
| 21 | |
| 22 | public function testValue($value): bool |
| 23 | { |
| 24 | $result = $this->getValueTester()?->testValue($value); |
| 25 | if ($result === null) return true; |
| 26 | return $result; |
| 27 | } |
| 28 | } |