@@ -90,9 +90,10 @@ public function finishView(FormView $view, FormInterface $form, array $options)
9090 $ tokenId = $ options ['csrf_token_id ' ] ?: ($ form ->getName () ?: \get_class ($ form ->getConfig ()->getType ()->getInnerType ()));
9191 $ data = (string ) $ options ['csrf_token_manager ' ]->getToken ($ tokenId );
9292
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 ' => 'csrf_token ' ,
9495 'mapped ' => false ,
95- ) );
96+ ] );
9697
9798 $ view ->children [$ options ['csrf_field_name ' ]] = $ csrfForm ->createView ($ view );
9899 }
@@ -103,20 +104,20 @@ public function finishView(FormView $view, FormInterface $form, array $options)
103104 */
104105 public function configureOptions (OptionsResolver $ resolver )
105106 {
106- $ resolver ->setDefaults (array (
107+ $ resolver ->setDefaults ([
107108 'csrf_protection ' => $ this ->defaultEnabled ,
108109 'csrf_field_name ' => $ this ->defaultFieldName ,
109110 'csrf_message ' => 'The CSRF token is invalid. Please try to resubmit the form. ' ,
110111 'csrf_token_manager ' => $ this ->defaultTokenManager ,
111112 'csrf_token_id ' => null ,
112- ) );
113+ ] );
113114 }
114115
115116 /**
116117 * {@inheritdoc}
117118 */
118119 public static function getExtendedTypes (): iterable
119120 {
120- return array ( FormType::class) ;
121+ return [ FormType::class] ;
121122 }
122123}
0 commit comments