private static function finalize_code_output($i, $output)
    {
        if (isset($output[$i]) && trim($output[$i])) {
            $output[$i] .= "\n```\n";
        } else {
            $output[$i] = "```";
        }

        return $output;
    }
private static function finalize_code_output($i, $output)
    {
        if (isset($output[$i]) && trim($output[$i])) {
            $output[$i] .= "\n```\n";
        } else {
            $output[$i] = "```";
        }

        return $output;
    }
private static function finalize_code_output ( $ i , $ output ) { if ( isset ( $ output [ $ i ] ) && trim ( $ output [ $ i ] ) ) { $ output [ $ i ] .= "\n```\n" ; } else { $ output [ $ i ] = "```" ; } return $ output ; }
Adds the closing code backticks. Removes trailing whitespace.

@param int
@param array

@return array
Adds the closing code backticks . Removes trailing whitespace .