File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public function enterNode(Node $node)
49
49
}
50
50
} elseif ('placeholder ' === $ item ->key ->value ) {
51
51
$ placeholderNode = $ item ;
52
- } elseif ('attr ' === $ item ->key ->value ) {
52
+ } elseif ('attr ' === $ item ->key ->value && $ item -> value instanceof Node \ Expr \Array_ ) {
53
53
foreach ($ item ->value ->items as $ attrValue ) {
54
54
if ('placeholder ' === $ attrValue ->key ->value ) {
55
55
$ placeholderNode = $ attrValue ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Translation \Extractor \Tests \Resources \Php \Symfony ;
4
+
5
+ class NotAnArrayAttrType
6
+ {
7
+ public function buildForm (FormBuilderInterface $ builder , array $ options )
8
+ {
9
+ $ builder
10
+ ->add ('field_with_function_as_attr_value ' , 'text ' , array (
11
+ 'attr ' => $ this ->getAttrFunction ()
12
+ ));
13
+ }
14
+
15
+ public function getAttrFunction ()
16
+ {
17
+ return array ('maxlength ' => 10 );
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments