@@ -19,11 +19,11 @@ |
||
| 19 | 19 | { |
| 20 | 20 | parent::register(); |
| 21 | 21 | |
| 22 | - if (class_exists('Laravel\Lumen\Application') && ! defined('SOCIALITEPROVIDERS_STATELESS')) { |
|
| 22 | + if (class_exists('Laravel\Lumen\Application') && !defined('SOCIALITEPROVIDERS_STATELESS')) { |
|
| 23 | 23 | define('SOCIALITEPROVIDERS_STATELESS', true); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - $this->app->singleton(ConfigRetrieverInterface::class, function () { |
|
| 26 | + $this->app->singleton(ConfigRetrieverInterface::class, function() { |
|
| 27 | 27 | return new ConfigRetriever(); |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | // check manually if a key is given and if it exists in the config |
| 26 | 26 | // this has to be done to check for spoofed additional config keys so that null isn't returned |
| 27 | - if (! empty($key) && empty($this->config[$key])) { |
|
| 27 | + if (!empty($key) && empty($this->config[$key])) { |
|
| 28 | 28 | return $default; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | protected $config; |
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | - * @param \SocialiteProviders\Manager\Contracts\OAuth1\ProviderInterface|\SocialiteProviders\Manager\Contracts\OAuth2\ProviderInterface $config |
|
| 15 | + * @param ConfigInterface $config |
|
| 16 | 16 | */ |
| 17 | 17 | public function setConfig(ConfigInterface $config) |
| 18 | 18 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function user() |
| 37 | 37 | { |
| 38 | - if (! $this->hasNecessaryVerifier()) { |
|
| 38 | + if (!$this->hasNecessaryVerifier()) { |
|
| 39 | 39 | throw new \InvalidArgumentException('Invalid request. Missing OAuth verifier.'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | if ($user instanceof User) { |
| 50 | 50 | parse_str($token['credentialsResponseBody'], $credentialsResponseBody); |
| 51 | 51 | |
| 52 | - if (! $credentialsResponseBody || ! is_array($credentialsResponseBody)) { |
|
| 52 | + if (!$credentialsResponseBody || !is_array($credentialsResponseBody)) { |
|
| 53 | 53 | throw new CredentialsException('Unable to parse token credentials response.'); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function redirect() |
| 85 | 85 | { |
| 86 | - if (! $this->isStateless()) { |
|
| 86 | + if (!$this->isStateless()) { |
|
| 87 | 87 | $this->request->getSession()->put( |
| 88 | 88 | 'oauth.temp', $temp = $this->server->getTemporaryCredentials() |
| 89 | 89 | ); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | protected function getToken() |
| 104 | 104 | { |
| 105 | - if (! $this->isStateless()) { |
|
| 105 | + if (!$this->isStateless()) { |
|
| 106 | 106 | $temp = $this->request->getSession()->get('oauth.temp'); |
| 107 | 107 | |
| 108 | 108 | return $this->server->getTokenCredentials( |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * @param \Laravel\Socialite\SocialiteManager $socialite |
| 77 | - * @param $providerName |
|
| 77 | + * @param string $providerName |
|
| 78 | 78 | * @param string $providerClass |
| 79 | 79 | * @param null|string $oauth1Server |
| 80 | 80 | * |
@@ -94,7 +94,6 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @param string $providerClass must extend Laravel\Socialite\One\AbstractProvider |
| 96 | 96 | * @param string $oauth1Server must extend League\OAuth1\Client\Server\Server |
| 97 | - * @param array $config |
|
| 98 | 97 | * @param mixed $providerName |
| 99 | 98 | * |
| 100 | 99 | * @return \Laravel\Socialite\One\AbstractProvider |
@@ -121,7 +120,6 @@ discard block |
||
| 121 | 120 | * |
| 122 | 121 | * @param SocialiteManager $socialite |
| 123 | 122 | * @param string $providerClass must extend Laravel\Socialite\Two\AbstractProvider |
| 124 | - * @param array $config |
|
| 125 | 123 | * @param mixed $providerName |
| 126 | 124 | * |
| 127 | 125 | * @return \Laravel\Socialite\Two\AbstractProvider |
@@ -145,7 +143,7 @@ discard block |
||
| 145 | 143 | * |
| 146 | 144 | * @throws \SocialiteProviders\Manager\Exception\MissingConfigException |
| 147 | 145 | * |
| 148 | - * @return array |
|
| 146 | + * @return string |
|
| 149 | 147 | */ |
| 150 | 148 | protected function getConfig($providerClass, $providerName) |
| 151 | 149 | { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $socialite->extend( |
| 63 | 63 | $providerName, |
| 64 | - function () use ($socialite, $providerName, $providerClass, $oauth1Server) { |
|
| 64 | + function() use ($socialite, $providerName, $providerClass, $oauth1Server) { |
|
| 65 | 65 | $provider = $this->buildProvider($socialite, $providerName, $providerClass, $oauth1Server); |
| 66 | 66 | if (defined('SOCIALITEPROVIDERS_STATELESS') && SOCIALITEPROVIDERS_STATELESS) { |
| 67 | 67 | return $provider->stateless(); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | private function isOAuth1($oauth1Server) |
| 175 | 175 | { |
| 176 | - return ! empty($oauth1Server); |
|
| 176 | + return !empty($oauth1Server); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | private function classExists($providerClass) |
| 198 | 198 | { |
| 199 | - if (! class_exists($providerClass)) { |
|
| 199 | + if (!class_exists($providerClass)) { |
|
| 200 | 200 | throw new InvalidArgumentException("{$providerClass} doesn't exist"); |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $this->getFromServices('client_id'), |
| 48 | 48 | $this->getFromServices('client_secret'), |
| 49 | 49 | $this->getFromServices('redirect'), |
| 50 | - $this->getConfigItems($additionalConfigKeys, function ($key) { |
|
| 50 | + $this->getConfigItems($additionalConfigKeys, function($key) { |
|
| 51 | 51 | return $this->getFromServices(strtolower($key)); |
| 52 | 52 | }) |
| 53 | 53 | ); |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | $keyExists = array_key_exists($key, $this->servicesArray); |
| 98 | 98 | |
| 99 | 99 | // ADDITIONAL value is empty |
| 100 | - if (! $keyExists && $this->isAdditionalConfig($key)) { |
|
| 100 | + if (!$keyExists && $this->isAdditionalConfig($key)) { |
|
| 101 | 101 | return; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // REQUIRED value is empty |
| 105 | - if (! $keyExists) { |
|
| 105 | + if (!$keyExists) { |
|
| 106 | 106 | throw new MissingConfigException("Missing services entry for {$this->providerName}.$key"); |
| 107 | 107 | } |
| 108 | 108 | |