Skip to content

Commit

Permalink
Properly set OAuth1 config, Add use statements
Browse files Browse the repository at this point in the history
  • Loading branch information
DraperStudio committed Apr 12, 2016
1 parent 8770267 commit 20e2b51
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/Helpers/ConfigRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use SocialiteProviders\Manager\Config;
use SocialiteProviders\Manager\Contracts\ConfigInterface;
use SocialiteProviders\Manager\Exception\MissingConfigException;
use SocialiteProviders\Manager\Contracts\Helpers\ConfigRetrieverInterface;

class ConfigRetriever implements \SocialiteProviders\Manager\Contracts\Helpers\ConfigRetrieverInterface
class ConfigRetriever implements ConfigRetrieverInterface
{
/**
* @var string
Expand Down
18 changes: 16 additions & 2 deletions src/OAuth1/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

namespace SocialiteProviders\Manager\OAuth1;

use Laravel\Socialite\One\AbstractProvider as BaseProvider;
use SocialiteProviders\Manager\SocialiteWasCalled;
use Symfony\Component\HttpFoundation\RedirectResponse;
use SocialiteProviders\Manager\ConfigTrait;
use SocialiteProviders\Manager\Contracts\ConfigInterface as Config;
use Symfony\Component\HttpFoundation\RedirectResponse;

abstract class AbstractProvider extends \Laravel\Socialite\One\AbstractProvider
abstract class AbstractProvider extends BaseProvider
{
use ConfigTrait;

Expand Down Expand Up @@ -150,4 +152,16 @@ public function with(array $parameters)

return $this;
}

/**
* @param Config $config
*
* @return $this
*/
public function setConfig(Config $config)
{
$this->config = $this->server->setConfig($config);

return $this;
}
}
6 changes: 5 additions & 1 deletion src/OAuth1/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
use GuzzleHttp\Exception\BadResponseException;
use League\OAuth1\Client\Credentials\TemporaryCredentials;
use League\OAuth1\Client\Credentials\TokenCredentials;
use SocialiteProviders\Manager\ConfigTrait;
use League\OAuth1\Client\Server\Server as BaseServer;

abstract class Server extends \League\OAuth1\Client\Server\Server
abstract class Server extends BaseServer
{
use ConfigTrait;

/**
* The custom parameters to be sent with the request.
*
Expand Down
4 changes: 3 additions & 1 deletion src/OAuth1/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace SocialiteProviders\Manager\OAuth1;

class User extends \Laravel\Socialite\One\User
use Laravel\Socialite\One\User as BaseUser;

class User extends BaseUser
{
/**
* The User Credentials.
Expand Down
3 changes: 2 additions & 1 deletion src/OAuth2/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use SocialiteProviders\Manager\Contracts\OAuth2\ProviderInterface;
use SocialiteProviders\Manager\SocialiteWasCalled;
use SocialiteProviders\Manager\ConfigTrait;
use Laravel\Socialite\Two\AbstractProvider as BaseProvider;

abstract class AbstractProvider extends \Laravel\Socialite\Two\AbstractProvider implements ProviderInterface
abstract class AbstractProvider extends BaseProvider implements ProviderInterface
{
use ConfigTrait;

Expand Down
4 changes: 3 additions & 1 deletion src/OAuth2/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace SocialiteProviders\Manager\OAuth2;

class User extends \Laravel\Socialite\Two\User
use Laravel\Socialite\Two\User as BaseUser;

class User extends BaseUser
{
/**
* The User Credentials.
Expand Down

0 comments on commit 20e2b51

Please sign in to comment.