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