@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * @param SocialiteManager $socialite |
| 75 | - * @param $providerName |
|
| 75 | + * @param string $providerName |
|
| 76 | 76 | * @param string $providerClass |
| 77 | 77 | * @param null|string $oauth1Server |
| 78 | 78 | * |
@@ -92,7 +92,6 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @param string $providerClass must extend Laravel\Socialite\One\AbstractProvider |
| 94 | 94 | * @param string $oauth1Server must extend League\OAuth1\Client\Server\Server |
| 95 | - * @param array $config |
|
| 96 | 95 | * |
| 97 | 96 | * @return \Laravel\Socialite\One\AbstractProvider |
| 98 | 97 | */ |
@@ -118,7 +117,6 @@ discard block |
||
| 118 | 117 | * |
| 119 | 118 | * @param SocialiteManager $socialite |
| 120 | 119 | * @param string $providerClass must extend Laravel\Socialite\Two\AbstractProvider |
| 121 | - * @param array $config |
|
| 122 | 120 | * |
| 123 | 121 | * @return \Laravel\Socialite\Two\AbstractProvider |
| 124 | 122 | */ |
@@ -141,7 +139,7 @@ discard block |
||
| 141 | 139 | * |
| 142 | 140 | * @throws MissingConfigException |
| 143 | 141 | * |
| 144 | - * @return array |
|
| 142 | + * @return Contracts\ConfigInterface |
|
| 145 | 143 | */ |
| 146 | 144 | protected function getConfig($providerClass, $providerName) |
| 147 | 145 | { |
@@ -202,6 +200,9 @@ discard block |
||
| 202 | 200 | } |
| 203 | 201 | } |
| 204 | 202 | |
| 203 | + /** |
|
| 204 | + * @param string|null $providerClass |
|
| 205 | + */ |
|
| 205 | 206 | private function classExists($providerClass) |
| 206 | 207 | { |
| 207 | 208 | if (! class_exists($providerClass)) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $socialite->extend( |
| 61 | 61 | $providerName, |
| 62 | - function () use ($socialite, $providerName, $providerClass, $oauth1Server) { |
|
| 62 | + function() use ($socialite, $providerName, $providerClass, $oauth1Server) { |
|
| 63 | 63 | $provider = $this->buildProvider($socialite, $providerName, $providerClass, $oauth1Server); |
| 64 | 64 | if (defined('SOCIALITEPROVIDERS_STATELESS') && SOCIALITEPROVIDERS_STATELESS) { |
| 65 | 65 | return $provider->stateless(); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | // We will use the $spoofedConfig variable for now as a way to find out if there was no |
| 155 | 155 | // configuration in the .env file which means we should not return anything and jump |
| 156 | 156 | // to the service config check to check if something can be found there. |
| 157 | - if (! static::$spoofedConfig) { |
|
| 157 | + if (!static::$spoofedConfig) { |
|
| 158 | 158 | return $config; |
| 159 | 159 | } |
| 160 | 160 | } catch (MissingConfigException $e) { |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | private function isOAuth1($oauth1Server) |
| 187 | 187 | { |
| 188 | - return ! empty($oauth1Server); |
|
| 188 | + return !empty($oauth1Server); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | private function classExists($providerClass) |
| 206 | 206 | { |
| 207 | - if (! class_exists($providerClass)) { |
|
| 207 | + if (!class_exists($providerClass)) { |
|
| 208 | 208 | throw new InvalidArgumentException("$providerClass doesn't exist"); |
| 209 | 209 | } |
| 210 | 210 | } |
@@ -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 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $this->getFromEnv('KEY'), |
| 48 | 48 | $this->getFromEnv('SECRET'), |
| 49 | 49 | $this->getFromEnv('REDIRECT_URI'), |
| 50 | - $this->getConfigItems($additionalConfigKeys, function ($key) { |
|
| 50 | + $this->getConfigItems($additionalConfigKeys, function($key) { |
|
| 51 | 51 | return $this->getFromEnv(strtoupper($key)); |
| 52 | 52 | })); |
| 53 | 53 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->getFromServices('client_id'), |
| 72 | 72 | $this->getFromServices('client_secret'), |
| 73 | 73 | $this->getFromServices('redirect'), |
| 74 | - $this->getConfigItems($additionalConfigKeys, function ($key) { |
|
| 74 | + $this->getConfigItems($additionalConfigKeys, function($key) { |
|
| 75 | 75 | return $this->getFromServices(strtolower($key)); |
| 76 | 76 | })); |
| 77 | 77 | } |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | $keyExists = array_key_exists($key, $this->servicesArray); |
| 121 | 121 | |
| 122 | 122 | // ADDITIONAL value is empty |
| 123 | - if (! $keyExists && $this->isAdditionalConfig($key)) { |
|
| 123 | + if (!$keyExists && $this->isAdditionalConfig($key)) { |
|
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // REQUIRED value is empty |
| 128 | - if (! $keyExists) { |
|
| 128 | + if (!$keyExists) { |
|
| 129 | 129 | throw new MissingConfigException("Missing services entry for {$this->providerName}.$key"); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | // REQUIRED value is empty |
| 153 | 153 | if (empty($item)) { |
| 154 | 154 | // If we are running in console we should spoof values to make Socialite happy... |
| 155 | - if (! app()->runningInConsole()) { |
|
| 155 | + if (!app()->runningInConsole()) { |
|
| 156 | 156 | throw new MissingConfigException("Configuration for $providerKey is missing."); |
| 157 | 157 | } |
| 158 | 158 | $item = $providerKey; |
@@ -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 | |
@@ -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( |