Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function check($value): bool |
||
33 | { |
||
34 | 2 | $this->requireParameters(['field', 'values']); |
|
35 | |||
36 | 2 | $anotherAttribute = $this->parameter('field'); |
|
37 | 2 | $definedValues = $this->parameter('values'); |
|
38 | 2 | $anotherValue = $this->getAttribute()->getValue($anotherAttribute); |
|
39 | |||
40 | if (! in_array($anotherValue, $definedValues, is_bool($anotherValue) || null === $anotherValue)) { |
||
41 | 2 | return parent::check($value); |
|
42 | } |
||
43 | |||
44 | 2 | return true; |
|
45 | } |
||
47 |