| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php namespace Vindi\Exceptions; |
||
| 43 | 10 | public function __construct($status, $errors, array $lastOptions = []) |
|
| 44 | { |
||
| 45 | 10 | $this->lastOptions = $lastOptions; |
|
| 46 | 10 | $this->errors = $errors; |
|
| 47 | 10 | $this->code = $status; |
|
| 48 | |||
| 49 | 10 | $this->ids = []; |
|
| 50 | 10 | $this->parameters = []; |
|
| 51 | 10 | $this->messages = []; |
|
| 52 | |||
| 53 | 10 | foreach ($errors as $error) { |
|
| 54 | 10 | $this->ids[] = $error->id; |
|
| 55 | 10 | if (isset($error->parameter)) { |
|
| 56 | 10 | $this->parameters[] = $error->parameter; |
|
| 57 | 10 | } |
|
| 58 | 10 | $this->messages[] = $error->message; |
|
| 59 | 10 | } |
|
| 60 | |||
| 61 | 10 | $this->message = trim(join('. ', $this->messages)); |
|
| 62 | 10 | } |
|
| 63 | |||
| 105 |