Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public static function checkMandatoryRules(array $rules, array $mandatoryKeys): bool |
||
38 | { |
||
39 | foreach ($mandatoryKeys as $key => $value) { |
||
40 | if (is_array($value)) { |
||
41 | if (isset($rules[$key])) { |
||
42 | return static::checkMandatoryRules($rules[$key], $value); |
||
43 | } else { |
||
44 | return false; |
||
45 | } |
||
46 | } else { |
||
47 | if (! isset($rules[$value])) { |
||
48 | return false; |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 | |||
53 | return true; |
||
54 | } |
||
56 |