| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.3244 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 7 | public function __construct(array $exceptions) |
|
| 20 | { |
||
| 21 | 7 | $message = ''; |
|
| 22 | |||
| 23 | 7 | $number = 1; |
|
| 24 | 7 | foreach ($exceptions as $exception) { |
|
| 25 | 5 | if (!$exception instanceof Throwable) { |
|
| 26 | $type = is_object($exception) ? get_class($exception) : gettype($exception); |
||
| 27 | $message = sprintf('An array of \Throwable is expected, "%s" given.', $type); |
||
| 28 | throw new InvalidArgumentException($message); |
||
| 29 | } |
||
| 30 | |||
| 31 | 5 | $message .= "\n Container #$number: {$exception->getMessage()}"; |
|
| 32 | 5 | $number++; |
|
| 33 | } |
||
| 34 | |||
| 35 | 7 | parent::__construct(sprintf("No definition or class found or resolvable in composite container:%s", $message)); |
|
| 36 | 7 | } |
|
| 38 |