dce0aeee48f815798fd8b4f7e416ff417f73bdda
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 declare(strict_types=1);
4
5 namespace CuyZ\Valinor\Mapper\Object\Exception;
6
7 use CuyZ\Valinor\Definition\ClassDefinition;
8 use CuyZ\Valinor\Mapper\Object\ObjectBuilder;
9 use RuntimeException;
10
11 use function array_map;
12 use function implode;
13
14 /** @internal */
15 final class ObjectBuildersCollision extends RuntimeException
16 {
17 public function __construct(ClassDefinition $class, ObjectBuilder ...$builders)
18 {
19 $constructors = array_map(fn (ObjectBuilder $builder) => $builder->signature(), $builders);
20 $constructors = implode('`, `', $constructors);
21
22 parent::__construct(
23 "A collision was detected between the following constructors of the class `{$class->type()->toString()}`: `$constructors`.",
24 1654955787
25 );
26 }
27 }