vendor/trikoder/oauth2-bundle/Security/Authentication/Token/OAuth2TokenFactory.php line 22

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Trikoder\Bundle\OAuth2Bundle\Security\Authentication\Token;
  4. use Psr\Http\Message\ServerRequestInterface;
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6. final class OAuth2TokenFactory
  7. {
  8.     /**
  9.      * @var string
  10.      */
  11.     private $rolePrefix;
  12.     public function __construct(string $rolePrefix)
  13.     {
  14.         $this->rolePrefix $rolePrefix;
  15.     }
  16.     public function createOAuth2Token(ServerRequestInterface $serverRequest, ?UserInterface $userstring $providerKey): OAuth2Token
  17.     {
  18.         return new OAuth2Token($serverRequest$user$this->rolePrefix$providerKey);
  19.     }
  20. }