public function formatCode(string $code, $enableColors): string
    {
        $block = [];
        $codeLines = explode("\n", $code);

        $this->enableColors = (bool)$enableColors;
        $this->numberOfLines = count($codeLines);
        $this->gutterWidth = strlen((string)$this->numberOfLines) + 1;

        $i = 0;
        foreach ($codeLines as $lineNumber => $line) {
            $i += 1;
            $this->prepareCodeLine($line, $block, $i);
        }

        return "\n" . $this->colorize(
                self::NORMAL . self::LIGHT_GRAY_BACKGROUND . self::WHITE,
                implode("\n", $block),
                self::RED
            );
    }