vendor/hwi/oauth-bundle/src/Security/Http/Firewall/RefreshAccessTokenListenerOld.php line 17

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the HWIOAuthBundle package.
  4.  *
  5.  * (c) Hardware Info <opensource@hardware.info>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace HWI\Bundle\OAuthBundle\Security\Http\Firewall;
  11. use HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\OAuthToken;
  12. use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
  13. class RefreshAccessTokenListenerOld extends RefreshAccessTokenListener
  14. {
  15.     private AuthenticationProviderInterface $oAuthProvider;
  16.     public function __construct(
  17.         AuthenticationProviderInterface $oAuthProvider
  18.     ) {
  19.         $this->oAuthProvider $oAuthProvider;
  20.     }
  21.     /**
  22.      * @template T of OAuthToken
  23.      *
  24.      * @param T $token
  25.      *
  26.      * @return T
  27.      */
  28.     protected function refreshToken(OAuthToken $token): OAuthToken
  29.     {
  30.         // @phpstan-ignore-next-line returns TokenInterface instead of OAuthToken
  31.         return $this->oAuthProvider->authenticate($token);
  32.     }
  33. }