File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
main/java/fr/adrienbrault/idea/symfony2plugin/util
test/java/fr/adrienbrault/idea/symfony2plugin/tests/stubs/indexes/fixtures Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,22 @@ public static String getAttributeValueByNameAsStringWithDefaultParameterFallback
6363 for (PhpAttribute .PhpAttributeArgument argument : attribute .getArguments ()) {
6464 PhpExpectedFunctionArgument argument1 = argument .getArgument ();
6565 if (argument1 .getArgumentIndex () == 0 ) {
66+ // what a mess here :)
67+ // createReference is stopping with exception on array values
68+ String value = argument1 .getValue ();
69+ String s = org .apache .commons .lang3 .StringUtils .normalizeSpace (value ).replaceAll ("[\\ n\\ t ]" , "" );
70+ if (s .startsWith ("['" ) || s .startsWith ("[\" " )) {
71+ continue ;
72+ }
6673
6774 // hint: reference is a complete fake object lazily created; it is not reflect the real element :(
6875 // PhpPsiElementFactory.createPhpPsiFromText => com.jetbrains.php.lang.psi.stubs.indexes.expectedArguments.PhpExpectedFunctionClassConstantArgument.createReference
69- @ NotNull PsiElement namedElement = argument1 .createReference (attribute .getProject ());
76+ @ NotNull PsiElement namedElement ;
77+ try {
78+ namedElement = argument1 .createReference (attribute .getProject ());
79+ } catch (AssertionError e ) {
80+ continue ;
81+ }
7082
7183 if (namedElement instanceof StringLiteralExpression ) {
7284 // we can trust the string representation here, looks to be right implemented
Original file line number Diff line number Diff line change @@ -204,6 +204,14 @@ public function attributesPathFoo1()
204204 public function attributesPathFoo2 ()
205205 {
206206 }
207+
208+ #[Route([
209+ 'cs ' => '/foobar/baz/{id} ' ,
210+ 'sk ' => '/foobarbaz/bat/{id} ' ,
211+ ], name: 'dashboard ' , methods: ['GET ' ])]
212+ public function nameAsArray ()
213+ {
214+ }
207215 }
208216}
209217
You can’t perform that action at this time.
0 commit comments