/** * @param LoggerInterface $logger * @param UrlGeneratorInterface $router * @param CsrfProviderInterface $csrfProvider * @param Client $client */ public function __construct(LoggerInterface $logger, UrlGeneratorInterface $router, SessionInterface $session, Client $client, $oauthKey, $oauthSecret) { $this->oauthKey = $oauthKey; $this->oauthSecret = $oauthSecret; $this->session = $session; $this->client = $client; $this->oauthClient = new OAuthClient(['identifier' => $oauthKey, 'secret' => $oauthSecret, 'callback_uri' => $router->generate('app_core_oauth_callback', ['providerName' => $this->getName()], true)]); parent::__construct($logger, $router); }
/** * @param LoggerInterface $logger * @param Client $client * @param UrlGeneratorInterface $router * @param CsrfProviderInterface $csrfProvider */ public function __construct(LoggerInterface $logger, Client $client, Discover $discover, Import $import, UrlGeneratorInterface $router, CsrfProviderInterface $csrfProvider, $oauthClientId, $oauthClientSecret) { $client->setDefaultOption('headers/Accept', 'application/vnd.github.v3'); $import->setProvider($this); $this->client = $client; $this->discover = $discover; $this->import = $import; $this->csrfProvider = $csrfProvider; $this->oauthClientId = $oauthClientId; $this->oauthClientSecret = $oauthClientSecret; $this->authorizeUrl = '/login/oauth/authorize'; parent::__construct($logger, $router); }