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