vendor/lexik/jwt-authentication-bundle/Security/Authenticator/ForwardCompatAuthenticatorTrait.php line 37

Open in your IDE?
  1. <?php
  2. namespace Lexik\Bundle\JWTAuthenticationBundle\Security\Authenticator;
  3. use Symfony\Component\HttpFoundation\Request;
  4. use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
  5. use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
  6. use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
  7. $r = new \ReflectionMethod(AuthenticatorInterface::class, 'authenticate');
  8. if (!trait_exists(ForwardCompatAuthenticatorTrait::class)) {
  9. if ($r->hasReturnType() && Passport::class === $r->getReturnType()->getName()) {
  10. eval('
  11. namespace Lexik\Bundle\JWTAuthenticationBundle\Security\Authenticator;
  12. use Symfony\Component\HttpFoundation\Request;
  13. use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
  14. /**
  15. * @internal
  16. */
  17. trait ForwardCompatAuthenticatorTrait
  18. {
  19. public function authenticate(Request $request): Passport
  20. {
  21. return $this->doAuthenticate($request);
  22. }
  23. }
  24. ');
  25. } else {
  26. /**
  27. * @internal
  28. */
  29. trait ForwardCompatAuthenticatorTrait
  30. {
  31. public function authenticate(Request $request): PassportInterface
  32. {
  33. return $this->doAuthenticate($request);
  34. }
  35. }
  36. }
  37. }