Search in sources :

Example 1 with Constant

use of com.jetbrains.php.lang.psi.elements.Constant in project idea-php-typo3-plugin by cedricziel.

the class TYPO3Utility method getTYPO3Version.

@Nullable
public static String getTYPO3Version(@NotNull Project project) {
    Constant versionConstant = getVersionConstant(project);
    if (versionConstant == null) {
        return null;
    }
    PsiElement value = versionConstant.getValue();
    if (value instanceof StringLiteralExpression) {
        return ((StringLiteralExpression) value).getContents();
    }
    return null;
}
Also used : StringLiteralExpression(com.jetbrains.php.lang.psi.elements.StringLiteralExpression) Constant(com.jetbrains.php.lang.psi.elements.Constant) PsiElement(com.intellij.psi.PsiElement) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with Constant

use of com.jetbrains.php.lang.psi.elements.Constant in project idea-php-typo3-plugin by cedricziel.

the class TYPO3Utility method getTYPO3Branch.

@Nullable
public static String getTYPO3Branch(@NotNull Project project) {
    Constant versionConstant = getBranchVersionConstant(project);
    if (versionConstant == null) {
        return null;
    }
    PsiElement value = versionConstant.getValue();
    if (value instanceof StringLiteralExpression) {
        return ((StringLiteralExpression) value).getContents();
    }
    return null;
}
Also used : StringLiteralExpression(com.jetbrains.php.lang.psi.elements.StringLiteralExpression) Constant(com.jetbrains.php.lang.psi.elements.Constant) PsiElement(com.intellij.psi.PsiElement) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

PsiElement (com.intellij.psi.PsiElement)2 Constant (com.jetbrains.php.lang.psi.elements.Constant)2 StringLiteralExpression (com.jetbrains.php.lang.psi.elements.StringLiteralExpression)2 Nullable (org.jetbrains.annotations.Nullable)2