Total Complexity | 7 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class MatchesRule implements RuleInterface |
||
11 | { |
||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | */ |
||
15 | public function run($value, array $input, array $args): bool |
||
16 | { |
||
17 | if (!$this->isParametersValid($input, $args)) { |
||
18 | return false; |
||
19 | } |
||
20 | return $value === $input[$args[0]]['value']; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | public function errorMessage(): string |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function canSkip(): bool |
||
35 | { |
||
36 | return true; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param array $input |
||
41 | * @param array $args |
||
42 | * @return bool |
||
43 | * @throws RuleException |
||
44 | */ |
||
45 | private function isParametersValid(array $input, array $args): bool |
||
54 | } |
||
55 | } |