public static function fromConstructs(array $constructs): self
    {
        $exception = new self(\sprintf(
            "Multiple definitions have been found for the following constructs:\n\n%s",
            \implode("\n", \array_map(static function (Construct $construct) {
                return \sprintf(
                    ' - "%s" defined in "%s"',
                    $construct->name(),
                    \implode('", "', $construct->fileNames())
                );
            }, $constructs))
        ));

        $exception->constructs = $constructs;

        return $exception;
    }
public static function fromConstructs(array $constructs): self
    {
        $exception = new self(\sprintf(
            "Multiple definitions have been found for the following constructs:\n\n%s",
            \implode("\n", \array_map(static function (Construct $construct) {
                return \sprintf(
                    ' - "%s" defined in "%s"',
                    $construct->name(),
                    \implode('", "', $construct->fileNames())
                );
            }, $constructs))
        ));

        $exception->constructs = $constructs;

        return $exception;
    }
public static function fromConstructs ( array $ constructs ) : self { $ exception = new self ( \ sprintf ( "Multiple definitions have been found for the following constructs:\n\n%s" , \ implode ( "\n" , \ array_map ( static function ( Construct $ construct ) { return \ sprintf ( ' - "%s" defined in "%s"' , $ construct -> name ( ) , \ implode ( '", "' , $ construct -> fileNames ( ) ) ) ; } , $ constructs ) ) ) ) ; $ exception -> constructs = $ constructs ; return $ exception ; }
Returns a new exception from constructs.

@param Construct[] $constructs

@return self
Returns a new exception from constructs .