/**
  * Extracts the path of the parent template file of the given template.
  *
  * Returns NULL in case the given template does not has a parent template.
  *
  * @param string $template The template to extract the parent template path from
  * @return string|null
  */
 private function extractParentTemplatePath($template)
 {
     // extract template tags from given template
     $templateTags = $this->templateCompiler->extractTemplateTags($template);
     // check whether at least one tag has been found
     if (isset($templateTags[0])) {
         // get first tag
         $firstTemplateTag = new TemplateTag($templateTags[0]);
         // return parent template path in case first tag is an extends-tag
         if ($firstTemplateTag->getTagName() === 'extends') {
             return $firstTemplateTag->getArgument(0);
         }
     }
     // given template does not has a parent template
     return null;
 }