public static function forCompileError(array $error, $code, $limit = 25)
    {
        $code = explode("\n", $code);
        $start = $error['line'] - $limit;
        if ($start < 0) {
            $start = 0;
        }

        $code = array_splice($code, $start, $limit * 2);

        foreach ($code as $i => $line) {
            $code[$i] = (++$start) . ': ' . $line;
        }

        $message = sprintf(
            self::COMPILE_ERROR,
            $error['message'],
            $error['line'],
            implode("\n", $code)
        );

        return new static($message);
    }
public static function forCompileError(array $error, $code, $limit = 25)
    {
        $code = explode("\n", $code);
        $start = $error['line'] - $limit;
        if ($start < 0) {
            $start = 0;
        }

        $code = array_splice($code, $start, $limit * 2);

        foreach ($code as $i => $line) {
            $code[$i] = (++$start) . ': ' . $line;
        }

        $message = sprintf(
            self::COMPILE_ERROR,
            $error['message'],
            $error['line'],
            implode("\n", $code)
        );

        return new static($message);
    }
public static function forCompileError ( array $ error , $ code , $ limit = 25 ) { $ code = explode ( "\n" , $ code ) ; $ start = $ error [ 'line' ] - $ limit ; if ( $ start < 0 ) { $ start = 0 ; } $ code = array_splice ( $ code , $ start , $ limit * 2 ) ; foreach ( $ code as $ i => $ line ) { $ code [ $ i ] = ( ++ $ start ) . ': ' . $ line ; } $ message = sprintf ( self :: COMPILE_ERROR , $ error [ 'message' ] , $ error [ 'line' ] , implode ( "\n" , $ code ) ) ; return new static ( $ message ) ; }
Triggered when there is a compiler error

@param *array  $error Error trace
@param *string $code
@param int     $limit The amount of lines to show

@return HandlebarsException
Triggered when there is a compiler error