Skip to content

Commit

Permalink
Merge pull request #1339 from bolt/tests/fix-failing-phpstan-check
Browse files Browse the repository at this point in the history
Fix phpstan failing on parser::create
  • Loading branch information
bobdenotter authored Apr 29, 2020
2 parents b0aa8c2 + 874899b commit cbe2177
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Security/LoginFormAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,

$user->setLastseenAt(new \DateTime());
$user->setLastIp($request->getClientIp());
$parsedUserAgent = Parser::create()->parse($request->headers->get('User-Agent'))->toString();
/** @var Parser $uaParser */
$uaParser = Parser::create();
$parsedUserAgent = $uaParser->parse($request->headers->get('User-Agent'))->toString();
$sessionLifetime = $request->getSession()->getMetadataBag()->getLifetime();
$expirationTime = (new \DateTime())->modify('+'.$sessionLifetime.' second');
$userAuthToken = UserAuthTokenRepository::factory($user, $parsedUserAgent, $expirationTime);
Expand Down

0 comments on commit cbe2177

Please sign in to comment.