| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Arcanedev\Support\Bases; |
||
| 53 | protected function formatErrors(Validator $validator) |
||
| 54 | { |
||
| 55 | if (is_null($this->errorsFormat)) { |
||
| 56 | return parent::formatErrors($validator); |
||
| 57 | } |
||
| 58 | |||
| 59 | $errors = []; |
||
| 60 | $messages = $validator->getMessageBag(); |
||
| 61 | |||
| 62 | foreach ($messages->keys() as $key) { |
||
| 63 | $errors[$key] = $messages->get($key, $this->errorsFormat); |
||
| 64 | } |
||
| 65 | |||
| 66 | return $errors; |
||
| 67 | } |
||
| 68 | } |
||
| 69 |