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