Skip to content

Commit

Permalink
Fix new Psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scheb committed Aug 21, 2020
1 parent d34489a commit e56ea82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,19 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
return [$providerId, $listenerId, $defaultEntryPoint];
}

public function createAuthenticator(ContainerBuilder $container, string $id, array $config, string $userProviderId): string
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
{
$twoFactorFirewallConfigId = $this->twoFactorServicesFactory->createTwoFactorFirewallConfig($container, $id, $config);
$successHandlerId = $this->twoFactorServicesFactory->createSuccessHandler($container, $id, $config, $twoFactorFirewallConfigId);
$failureHandlerId = $this->twoFactorServicesFactory->createFailureHandler($container, $id, $config, $twoFactorFirewallConfigId);
$authRequiredHandlerId = $this->twoFactorServicesFactory->createAuthenticationRequiredHandler($container, $id, $config, $twoFactorFirewallConfigId);
$this->twoFactorServicesFactory->createKernelExceptionListener($container, $id, $authRequiredHandlerId);
$this->twoFactorServicesFactory->createAccessListener($container, $id, $twoFactorFirewallConfigId);
$this->twoFactorServicesFactory->createProviderPreparationListener($container, $id, $config);
$twoFactorFirewallConfigId = $this->twoFactorServicesFactory->createTwoFactorFirewallConfig($container, $firewallName, $config);
$successHandlerId = $this->twoFactorServicesFactory->createSuccessHandler($container, $firewallName, $config, $twoFactorFirewallConfigId);
$failureHandlerId = $this->twoFactorServicesFactory->createFailureHandler($container, $firewallName, $config, $twoFactorFirewallConfigId);
$authRequiredHandlerId = $this->twoFactorServicesFactory->createAuthenticationRequiredHandler($container, $firewallName, $config, $twoFactorFirewallConfigId);
$this->twoFactorServicesFactory->createKernelExceptionListener($container, $firewallName, $authRequiredHandlerId);
$this->twoFactorServicesFactory->createAccessListener($container, $firewallName, $twoFactorFirewallConfigId);
$this->twoFactorServicesFactory->createProviderPreparationListener($container, $firewallName, $config);

return $this->createAuthenticatorService(
$container,
$id,
$firewallName,
$twoFactorFirewallConfigId,
$successHandlerId,
$failureHandlerId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
return $this->successHandler->onAuthenticationSuccess($request, $token);
}

public function onAuthenticationFailure(Request $request, AuthenticationException $failureException): ?Response
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
{
/** @var TwoFactorTokenInterface $currentToken */
$currentToken = $this->tokenStorage->getToken();
$this->logger->info('Two-factor authentication request failed.', ['exception' => $failureException]);
$this->logger->info('Two-factor authentication request failed.', ['exception' => $exception]);
$this->dispatchTwoFactorAuthenticationEvent(TwoFactorAuthenticationEvents::FAILURE, $request, $currentToken);

return $this->failureHandler->onAuthenticationFailure($request, $failureException);
return $this->failureHandler->onAuthenticationFailure($request, $exception);
}

private function dispatchTwoFactorAuthenticationEvent(string $eventType, Request $request, TokenInterface $token): void
Expand Down

0 comments on commit e56ea82

Please sign in to comment.