protected function getInvalidResult(string $code, array $parameters = null): ResultInterface
    {
        $templates = $this->getTemplates();
        if (array_key_exists($code, $templates) === false) {
            throw new TemplateNotFound($code);
        }

        return new InvalidResult($code, $templates[$code], $parameters ?? []);
    }