b6bf3bc081318cad595cceaac231c06323ea7e87
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 declare(strict_types=1);
4
5 namespace CuyZ\Valinor\Type\Parser\Exception\Iterable;
6
7 use CuyZ\Valinor\Type\Parser\Exception\InvalidType;
8 use CuyZ\Valinor\Type\Types\ShapedArrayElement;
9 use RuntimeException;
10
11 use function implode;
12
13 /** @internal */
14 final class ShapedArrayClosingBracketMissing extends RuntimeException implements InvalidType
15 {
16 /**
17 * @param ShapedArrayElement[] $elements
18 */
19 public function __construct(array $elements)
20 {
21 $signature = 'array{' . implode(', ', array_map(fn (ShapedArrayElement $element) => $element->toString(), $elements));
22
23 parent::__construct(
24 "Missing closing curly bracket in shaped array signature `$signature`.",
25 1631283658
26 );
27 }
28 }