Skip to content

Commit 5e7a232

Browse files
committed
fix change "deprecated" doc tag php message extraction
1 parent a4929d2 commit 5e7a232

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/inspection/TwigExtensionDeprecatedInspection.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ private String getClassDeprecatedMessage(@NotNull PhpClass phpClass) {
7777
PhpDocComment docComment = phpClass.getDocComment();
7878
if (docComment != null) {
7979
for (PhpDocTag deprecatedTag : docComment.getTagElementsByName("@deprecated")) {
80-
String tagValue = deprecatedTag.getTagValue();
80+
// deprecatedTag.getValue provides a number !?
81+
String tagValue = deprecatedTag.getText();
8182
if (StringUtils.isNotBlank(tagValue)) {
82-
return StringUtils.abbreviate("Deprecated: " + tagValue, 100);
83+
String trim = tagValue.replace("@deprecated", "").trim();
84+
85+
if (StringUtils.isNotBlank(tagValue)) {
86+
return StringUtils.abbreviate("Deprecated: " + trim, 100);
87+
}
8388
}
8489
}
8590
}

0 commit comments

Comments
 (0)