public static function format(
        $errors,
        $format = '#%1$d: %2$s (near "%4$s" at position %5$d)'
    ) {
        $ret = [];

        $i = 0;
        foreach ($errors as $key => $err) {
            $ret[$key] = sprintf(
                $format,
                ++$i,
                $err[0],
                $err[1],
                htmlspecialchars((string) $err[2]),
                $err[3]
            );
        }

        return $ret;
    }
public static function format(
        $errors,
        $format = '#%1$d: %2$s (near "%4$s" at position %5$d)'
    ) {
        $ret = [];

        $i = 0;
        foreach ($errors as $key => $err) {
            $ret[$key] = sprintf(
                $format,
                ++$i,
                $err[0],
                $err[1],
                htmlspecialchars((string) $err[2]),
                $err[3]
            );
        }

        return $ret;
    }
public static function format ( $ errors , $ format = '#%1$d: %2$s (near "%4$s" at position %5$d)' ) { $ ret = [ ] ; $ i = 0 ; foreach ( $ errors as $ key => $ err ) { $ ret [ $ key ] = sprintf ( $ format , ++ $ i , $ err [ 0 ] , $ err [ 1 ] , htmlspecialchars ( ( string ) $ err [ 2 ] ) , $ err [ 3 ] ) ; } return $ ret ; }
Formats the specified errors.

@param array  $errors the errors to be formatted
@param string $format The format of an error.
'$1$d' is replaced by the position of this error.
'$2$s' is replaced by the error message.
'$3$d' is replaced by the error code.
'$4$s' is replaced by the string that caused the
issue.
'$5$d' is replaced by the position of the string.

@return array
Formats the specified errors .