3 declare(strict_types=1);
5 namespace CuyZ\Valinor\Mapper\Object\Exception;
7 use CuyZ\Valinor\Definition\ClassDefinition;
8 use CuyZ\Valinor\Mapper\Object\ObjectBuilder;
11 use function array_map;
15 final class ObjectBuildersCollision extends RuntimeException
17 public function __construct(ClassDefinition $class, ObjectBuilder ...$builders)
19 $constructors = array_map(fn (ObjectBuilder $builder) => $builder->signature(), $builders);
20 $constructors = implode('`, `', $constructors);
23 "A collision was detected between the following constructors of the class `{$class->type()->toString()}`: `$constructors`.",