public function resolve($templatePath)
    {
        $templatePathReal = realpath($templatePath);

        if ($templatePathReal === false) {
            throw new \Exception(
                'Template file does not exist: ' . $templatePath
            );
        }

        if ($this->hasCache($templatePathReal)) {
            return $this->getCache($templatePathReal);
        }

        $template = file_get_contents(
            $templatePathReal
        );

        $this->setCache($templatePathReal, $template);

        return $template;
    }