8000 fix blank string condition for string lcfirst converting #786 · Koc/idea-php-symfony2-plugin@a701f48 · GitHub
[go: up one dir, main page]

Skip to content

Commit a701f48

Browse files
committed
fix blank string condition for string lcfirst converting Haehnchen#786
1 parent de0c541 commit a701f48

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/fr/adrienbrault/idea/symfony2plugin/form/FormUnderscoreMethodReference.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ public FormUnderscoreMethodReference(@NotNull StringLiteralExpression element, @
2929
@NotNull
3030
@Override
3131
public ResolveResult[] multiResolve(boolean incompleteCode) {
32+
String contents = getElement().getContents();
33+
if(org.apache.commons.lang.StringUtils.isBlank(contents)) {
34+
return new ResolveResult[0];
35+
}
36+
3237
Collection<PsiElement> psiElements = new ArrayList<>();
3338

34-
Set<String> methods = getCamelizeAndUnderscoreString(getElement().getContents());
39+
Set<String> methods = getCamelizeAndUnderscoreString(contents);
3540

3641
// provide setter fallback for non model class or or unknown methods
3742
for (String value : methods) {

src/fr/adrienbrault/idea/symfony2plugin/util/StringUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public static String ucfirst(String chaine){
3737

3838
@NotNull
3939
public static String lcfirst(@NotNull String input){
40+
if(input.length() < 1) {
41+
return input;
42+
}
43+
4044
return Character.toLowerCase(input.charAt(0)) +
4145
(input.length() > 1 ? input.substring(1) : "");
4246
}

0 commit comments

Comments
 (0)
0