protected function createView(string $view, array $data): string
    {
        if ($this->viewFactory !== null) {
            return $this->viewFactory->create($view, $data)->render();
        }

        return \vsprintf($view, $data);
    }