getConfigurableOptions(); $configured = array_intersect_key($options, array_flip($possible)); foreach ($configured as $key => $value) { $this->$key = $value; } $options = array_diff_key($options, $configured); parent::__construct($options); } protected function getConfigurableOptions() { return [ 'accessTokenMethod', 'accessTokenResourceOwnerId', 'scopeSeparator', 'responseError', 'responseCode', 'responseResourceOwnerId', 'scopes', ]; } public function getBaseAuthorizationUrl() { return $this->domain . self::PATH_AUTHORIZE; } public function getBaseAccessTokenUrl(array $params) { return $this->domain . self::PATH_TOKEN; } public function getResourceOwnerDetailsUrl(AccessToken $token) { return $this->resourceDomain . self::USER_RESOURCE; } public function getDefaultScopes() { return $this->scopes; } protected function getScopeSeparator() { return self::SCOPE_SEPARATOR; } protected function checkResponse(ResponseInterface $response, $data) { if (!empty($data[$this->responseError])) { $error = $data[$this->responseError]; $code = $this->responseCode ? $data[$this->responseCode] : 0; throw new TwitchHelixIdentityProviderException($error, $code, $data); } } protected function createResourceOwner(array $response, AccessToken $token) { return new TwitchHelixResourceOwner($response); } protected function getDefaultHeaders() { return [ 'Client-ID' => $this->clientId ]; } protected function getAuthorizationHeaders($token = null) { if ($token === null) { return []; } return [ 'Authorization' => 'Bearer '. $token ]; } }