| Conditions | 7 |
| Paths | 6 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function __construct($errors, Throwable $previous = null) |
||
| 28 | { |
||
| 29 | $this->errors = $errors instanceof ErrorBag ? $errors->getErrors() : (array) $errors; |
||
| 30 | if (!$previous && $errors instanceof ErrorBag && $errors->hasErrors()) { |
||
| 31 | $this->exceptions = $errors->getExceptions(); |
||
| 32 | $tmp = reset($this->exceptions); |
||
| 33 | if ($tmp) { |
||
| 34 | $previous = reset($tmp) ? : null; |
||
| 35 | } |
||
| 36 | } |
||
| 37 | parent::__construct(422, 'A validation error occurred', $previous); |
||
| 38 | } |
||
| 63 |