@@ -90,9 +90,10 @@ public function finishView(FormView $view, FormInterface $form, array $options)
90
90
$ tokenId = $ options ['csrf_token_id ' ] ?: ($ form ->getName () ?: \get_class ($ form ->getConfig ()->getType ()->getInnerType ()));
91
91
$ data = (string ) $ options ['csrf_token_manager ' ]->getToken ($ tokenId );
92
92
93
- $ csrfForm = $ factory ->createNamed ($ options ['csrf_field_name ' ], 'Symfony\Component\Form\Extension\Core\Type\HiddenType ' , $ data , array (
93
+ $ csrfForm = $ factory ->createNamed ($ options ['csrf_field_name ' ], 'Symfony\Component\Form\Extension\Core\Type\HiddenType ' , $ data , [
94
+ 'block_prefix ' => 'token ' ,
94
95
'mapped ' => false ,
95
- ) );
96
+ ] );
96
97
97
98
$ view ->children [$ options ['csrf_field_name ' ]] = $ csrfForm ->createView ($ view );
98
99
}
@@ -103,20 +104,20 @@ public function finishView(FormView $view, FormInterface $form, array $options)
103
104
*/
104
105
public function configureOptions (OptionsResolver $ resolver )
105
106
{
106
- $ resolver ->setDefaults (array (
107
+ $ resolver ->setDefaults ([
107
108
'csrf_protection ' => $ this ->defaultEnabled ,
108
109
'csrf_field_name ' => $ this ->defaultFieldName ,
109
110
'csrf_message ' => 'The CSRF token is invalid. Please try to resubmit the form. ' ,
110
111
'csrf_token_manager ' => $ this ->defaultTokenManager ,
111
112
'csrf_token_id ' => null ,
112
- ) );
113
+ ] );
113
114
}
114
115
115
116
/**
116
117
* {@inheritdoc}
117
118
*/
118
119
public static function getExtendedTypes (): iterable
119
120
{
120
- return array ( FormType::class) ;
121
+ return [ FormType::class] ;
121
122
}
122
123
}
0 commit comments