| Total Complexity | 6 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 92.31% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | final class RulesDumper |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Return all attribute rules as array. |
||
| 20 | * |
||
| 21 | * For example: |
||
| 22 | * |
||
| 23 | * ```php |
||
| 24 | * [ |
||
| 25 | * 'amount' => [ |
||
| 26 | * [ |
||
| 27 | * 'number', |
||
| 28 | * 'integer' => true, |
||
| 29 | * 'max' => 100, |
||
| 30 | * 'notANumberMessage' => 'Value must be an integer.', |
||
| 31 | * 'tooBigMessage' => 'Value must be no greater than 100.' |
||
| 32 | * ], |
||
| 33 | * ['callback'], |
||
| 34 | * ], |
||
| 35 | * 'name' => [ |
||
| 36 | * [ |
||
| 37 | * 'hasLength', |
||
| 38 | * 'max' => 20, |
||
| 39 | * 'message' => 'Value must contain at most 20 characters.' |
||
| 40 | * ], |
||
| 41 | * ], |
||
| 42 | * ] |
||
| 43 | * ``` |
||
| 44 | * |
||
| 45 | * @param iterable $ruleSetMap |
||
| 46 | * |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | 6 | public function asArray(iterable $ruleSetMap, bool $dumpRuleName): array |
|
| 52 | } |
||
| 53 | |||
| 54 | 6 | private function fetchOptions(iterable $rules, bool $dumpRuleName): array |
|
| 80 |