private function resolveFileName($name): string
    {
        $filename = $this->getFilename($name);
        if ($filename === false) {
            throw new LoaderError(sprintf('Template "%s" is not defined.', $name));
        }

        return $filename;
    }