@@ -50,10 +50,18 @@ class TwoFactorFactory implements SecurityFactoryInterface
5050 public const PROVIDER_PREPARATION_LISTENER_DEFINITION_ID = 'scheb_two_factor.security.provider_preparation_listener ' ;
5151 public const AUTHENTICATION_SUCCESS_EVENT_SUPPRESSOR_ID = 'scheb_two_factor.security.authentication_success_event_suppressor ' ;
5252
53+ /**
54+ * @return void
55+ */
5356 public function addConfiguration (NodeDefinition $ node )
5457 {
5558 /** @var ArrayNodeDefinition $node */
5659 $ builder = $ node ->children ();
60+
61+ /**
62+ * @psalm-suppress PossiblyNullReference
63+ * @psalm-suppress PossiblyUndefinedMethod
64+ */
5765 $ builder
5866 ->scalarNode ('check_path ' )->defaultValue (self ::DEFAULT_CHECK_PATH )->end ()
5967 ->scalarNode ('auth_form_path ' )->defaultValue (self ::DEFAULT_AUTH_FORM_PATH )->end ()
@@ -75,13 +83,21 @@ public function addConfiguration(NodeDefinition $node)
7583 ;
7684 }
7785
78- public function create (ContainerBuilder $ container , $ firewallName , $ config , $ userProvider , $ defaultEntryPoint )
86+ /**
87+ * @param string $id
88+ * @param array $config
89+ * @param string $userProvider
90+ * @param string|null $defaultEntryPoint
91+ *
92+ * @return array
93+ */
94+ public function create (ContainerBuilder $ container , $ id , $ config , $ userProvider , $ defaultEntryPoint )
7995 {
80- $ providerId = $ this ->createAuthenticationProvider ($ container , $ firewallName , $ config );
81- $ listenerId = $ this ->createAuthenticationListener ($ container , $ firewallName , $ config );
82- $ this ->createProviderPreparationListener ($ container , $ firewallName , $ config );
83- $ this ->createAuthenticationSuccessEventSuppressor ($ container , $ firewallName , $ config );
84- $ this ->createTwoFactorFirewallConfig ($ container , $ firewallName , $ config );
96+ $ providerId = $ this ->createAuthenticationProvider ($ container , $ id , $ config );
97+ $ listenerId = $ this ->createAuthenticationListener ($ container , $ id , $ config );
98+ $ this ->createProviderPreparationListener ($ container , $ id , $ config );
99+ $ this ->createAuthenticationSuccessEventSuppressor ($ container , $ id );
100+ $ this ->createTwoFactorFirewallConfig ($ container , $ id , $ config );
85101
86102 return [$ providerId , $ listenerId , $ defaultEntryPoint ];
87103 }
@@ -213,7 +229,7 @@ private function createProviderPreparationListener(ContainerBuilder $container,
213229 ->addTag ('kernel.event_listener ' , ['event ' => 'kernel.finish_request ' , 'method ' => 'onKernelFinishRequest ' ]);
214230 }
215231
216- private function createAuthenticationSuccessEventSuppressor (ContainerBuilder $ container , string $ firewallName, array $ config ): void
232+ private function createAuthenticationSuccessEventSuppressor (ContainerBuilder $ container , string $ firewallName ): void
217233 {
218234 $ firewallConfigId = self ::AUTHENTICATION_SUCCESS_EVENT_SUPPRESSOR_ID_PREFIX .$ firewallName ;
219235 $ container
0 commit comments