autowp/external-login-service

View on GitHub
src/Github.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
 
declare(strict_types=1);
 
namespace Autowp\ExternalLoginService;
 
use League\OAuth2\Client\Provider\Github as GithubProvider;
 
class Github extends AbstractLeagueOAuth2
{
Possibly zero references to protected method `\Autowp\ExternalLoginService\Github::createProvider()`
protected function createProvider(): GithubProvider
{
return new GithubProvider([
'clientId' => $this->options['clientId'],
'clientSecret' => $this->options['clientSecret'],
'redirectUri' => $this->options['redirectUri'],
]);
}
 
protected function getAuthorizationUrl(): string
{
return $this->getProvider()->getAuthorizationUrl();
}
 
Possibly zero references to protected method `\Autowp\ExternalLoginService\Github::getFriendsAuthorizationUrl()`
protected function getFriendsAuthorizationUrl(): string
{
return '';
}
 
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
Parameter `$options` is never used
Possibly zero references to public method `\Autowp\ExternalLoginService\Github::getData()`
public function getData(array $options): Result
{
$provider = $this->getProvider();
 
$ownerDetails = $provider->getResourceOwner($this->accessToken);
$data = $ownerDetails->toArray();
 
return new Result([
'externalId' => $data['id'],
'name' => $data['name'],
'profileUrl' => $data['html_url'],
'photoUrl' => $data['avatar_url'],
]);
}
 
Possibly zero references to public method `\Autowp\ExternalLoginService\Github::getFriendsUrl()`
public function getFriendsUrl(): string
{
return '';
}
 
Possibly zero references to public method `\Autowp\ExternalLoginService\Github::getFriends()`
public function getFriends(): array
{
return [];
}
}