@@ -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( |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $socialite->extend( |
65 | 65 | $providerName, |
66 | - function () use ($socialite, $providerName, $providerClass, $oauth1Server) { |
|
66 | + function() use ($socialite, $providerName, $providerClass, $oauth1Server) { |
|
67 | 67 | $provider = $this->buildProvider($socialite, $providerName, $providerClass, $oauth1Server); |
68 | 68 | if (defined('SOCIALITEPROVIDERS_STATELESS') && SOCIALITEPROVIDERS_STATELESS) { |
69 | 69 | return $provider->stateless(); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | private function isOAuth1($oauth1Server) |
193 | 193 | { |
194 | - return ! empty($oauth1Server); |
|
194 | + return !empty($oauth1Server); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | private function classExists($providerClass) |
216 | 216 | { |
217 | - if (! class_exists($providerClass)) { |
|
217 | + if (!class_exists($providerClass)) { |
|
218 | 218 | throw new InvalidArgumentException("$providerClass doesn't exist"); |
219 | 219 | } |
220 | 220 | } |