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)
4949 }
5050 } elseif ('placeholder ' === $ item ->key ->value ) {
5151 $ placeholderNode = $ item ;
52- } elseif ('attr ' === $ item ->key ->value ) {
52+ } elseif ('attr ' === $ item ->key ->value && $ item -> value instanceof Node \ Expr \Array_ ) {
5353 foreach ($ item ->value ->items as $ attrValue ) {
5454 if ('placeholder ' === $ attrValue ->key ->value ) {
5555 $ 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