private function getRenderer(int $target): RendererInterface
    {
        if ($target == self::OUTPUT && System::isCLI()) {
            if (System::isColorsSupported(STDOUT)) {
                $target = self::OUTPUT_CLI_COLORS;
            } else {
                $target = self::OUTPUT_CLI;
            }
        }

        if (!isset($this->targets[$target])) {
            throw new DumperException(sprintf("Undefined dump target %d", $target));
        }

        if (is_string($this->targets[$target])) {
            $this->targets[$target] = new $this->targets[$target]();
        }

        return $this->targets[$target];
    }