public static Map<String, PsiElement> getTemplateAnnotationFiles(PhpDocTag phpDocTag) {

    // find template name on annotation parameter
    // @Template("templatename")
    PhpPsiElement phpDocAttrList = phpDocTag.getFirstPsiChild();
    if (phpDocAttrList == null) {
      return null;
    }

    String tagValue = phpDocAttrList.getText();
    Matcher matcher = Pattern.compile("\\(\"(.*)\"").matcher(tagValue);

    Map<String, PsiElement> templateFiles = new HashMap<String, PsiElement>();

    if (matcher.find()) {
      // @TODO: only one should possible; refactor getTemplatePsiElements
      PsiElement[] psiElement =
          TwigHelper.getTemplatePsiElements(phpDocTag.getProject(), matcher.group(1));
      if (psiElement.length > 0) {
        templateFiles.put(matcher.group(1), psiElement[0]);
      }
    }

    return templateFiles;
  }
  /** array('foo' => 'bar', 'foo1' => 'bar', 1 => 'foo') */
  public static HashMap<String, String> getArrayKeyValueMap(
      @NotNull ArrayCreationExpression arrayCreationExpression) {
    HashMap<String, String> keys = new HashMap<String, String>();

    for (ArrayHashElement arrayHashElement : arrayCreationExpression.getHashElements()) {
      PhpPsiElement child = arrayHashElement.getKey();
      if (child != null
          && ((child instanceof StringLiteralExpression)
              || PhpPatterns.psiElement(PhpElementTypes.NUMBER).accepts(child))) {

        String key;
        if (child instanceof StringLiteralExpression) {
          key = ((StringLiteralExpression) child).getContents();
        } else {
          key = child.getText();
        }

        if (StringUtils.isBlank(key)) {
          continue;
        }

        String value = null;

        if (arrayHashElement.getValue() instanceof StringLiteralExpression) {
          value = ((StringLiteralExpression) arrayHashElement.getValue()).getContents();
        }

        keys.put(key, value);
      }
    }

    return keys;
  }