| Conditions | 3 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public function __construct( |
||
| 16 | ?string $scope, |
||
| 17 | protected array $exceptions, |
||
| 18 | ) { |
||
| 19 | $count = \count($exceptions); |
||
| 20 | parent::__construct( |
||
| 21 | $scope, |
||
| 22 | \sprintf( |
||
| 23 | "%s thrown during finalization of %s:\n%s", |
||
| 24 | $count === 1 ? 'An exception has been' : "$count exceptions have been", |
||
| 25 | $scope === null ? 'an unnamed scope' : "the scope `$scope`", |
||
| 26 | \implode("\n\n", \array_map( |
||
| 27 | static fn (Exception $e): string => \sprintf( |
||
| 28 | "# %s\n%s", |
||
| 29 | $e::class, |
||
| 30 | $e->getMessage(), |
||
| 31 | ), |
||
| 32 | $exceptions, |
||
| 33 | )), |
||
| 46 |