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