@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * {@inheritDoc} |
| 115 | 115 | */ |
| 116 | - public function getUsername() : ?string |
|
| 116 | + public function getUsername() : ? string |
|
| 117 | 117 | { |
| 118 | 118 | return $this->username; |
| 119 | 119 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | /** |
| 122 | 122 | * {@inheritDoc} |
| 123 | 123 | */ |
| 124 | - public function getName() : ?string |
|
| 124 | + public function getName() : ? string |
|
| 125 | 125 | { |
| 126 | 126 | return $this->name; |
| 127 | 127 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | /** |
| 130 | 130 | * {@inheritDoc} |
| 131 | 131 | */ |
| 132 | - public function getEmail() : ?string |
|
| 132 | + public function getEmail() : ? string |
|
| 133 | 133 | { |
| 134 | 134 | return $this->email; |
| 135 | 135 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | /** |
| 138 | 138 | * {@inheritDoc} |
| 139 | 139 | */ |
| 140 | - public function getAvatar() : ?string |
|
| 140 | + public function getAvatar() : ? string |
|
| 141 | 141 | { |
| 142 | 142 | return $this->avatar; |
| 143 | 143 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function identify(auth\Credentials $credentials) : Promise |
| 96 | 96 | { |
| 97 | - return $this->request('GET', $this->getIdentifyUrl(), $credentials)->then(function (array $data) use ($credentials) { |
|
| 97 | + return $this->request('GET', $this->getIdentifyUrl(), $credentials)->then(function(array $data) use ($credentials) { |
|
| 98 | 98 | return $this->createIdentity($credentials, $data); |
| 99 | 99 | }); |
| 100 | 100 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | return $this->getHttpClient() |
| 162 | 162 | ->requestAsync('POST', $url, array_merge_recursive($this->getDefaultRequestOptions($temporary), $options)) |
| 163 | - ->then(function (Response $response) use($temporary) { |
|
| 163 | + ->then(function(Response $response) use($temporary) { |
|
| 164 | 164 | |
| 165 | 165 | // We are assuming a form-encoded body here - for any Provider that does not return those in this format |
| 166 | 166 | // for handshakes and exchanges this will require refactoring. |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | protected function normalizeParameters(array $params) : array |
| 96 | 96 | { |
| 97 | 97 | // Recursively percent encode each key/value pair in the params. |
| 98 | - array_walk_recursive($params, function (&$key, &$value) { |
|
| 98 | + array_walk_recursive($params, function(&$key, &$value) { |
|
| 99 | 99 | $key = rawurlencode(rawurldecode($key)); |
| 100 | 100 | $value = rawurlencode(rawurldecode($value)); |
| 101 | 101 | }); |
@@ -152,6 +152,6 @@ discard block |
||
| 152 | 152 | { |
| 153 | 153 | // The joining ampersand after the encoded Client's secret is correctly left in even if no Token is being |
| 154 | 154 | // included in the key. |
| 155 | - return rawurlencode($client->getSecret()) . '&' . (isset($token) ? rawurlencode($token->getSecret()) : ''); |
|
| 155 | + return rawurlencode($client->getSecret()).'&'.(isset($token) ? rawurlencode($token->getSecret()) : ''); |
|
| 156 | 156 | } |
| 157 | 157 | } |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function getIdentifyUrl() : string |
| 35 | 35 | { |
| 36 | - return static::URL_IDENTIFY . $this->shouldProvideEmailAddress() ? '?include_email=true' : ''; |
|
| 36 | + return static::URL_IDENTIFY.$this->shouldProvideEmailAddress() ? '?include_email=true' : ''; |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * |
| 109 | 109 | * @return auth\Token |
| 110 | 110 | */ |
| 111 | - public function getRefreshToken() : ?auth\Token |
|
| 111 | + public function getRefreshToken() : ? auth\Token |
|
| 112 | 112 | { |
| 113 | 113 | return $this->refreshToken; |
| 114 | 114 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * |
| 139 | 139 | * @return int |
| 140 | 140 | */ |
| 141 | - public function getExpiry() : ?int |
|
| 141 | + public function getExpiry() : ? int |
|
| 142 | 142 | { |
| 143 | 143 | return $this->expiry; |
| 144 | 144 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'grant_type' => 'authorization_code', |
| 68 | 68 | 'code' => $code |
| 69 | 69 | ] |
| 70 | - ])->then(function (array $data) { |
|
| 70 | + ])->then(function(array $data) { |
|
| 71 | 71 | return $this->createToken($data); |
| 72 | 72 | }); |
| 73 | 73 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function identify(oauth2\Token $token) : Promise |
| 79 | 79 | { |
| 80 | - return $this->request('GET', $this->getIdentifyUrl(), $token)->then(function (array $data) use ($token) { |
|
| 80 | + return $this->request('GET', $this->getIdentifyUrl(), $token)->then(function(array $data) use ($token) { |
|
| 81 | 81 | return $this->createIdentity($token, $data); |
| 82 | 82 | }); |
| 83 | 83 | } |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | // Intercept the flow - instead of directly returning a Promise for the entity's identity data, |
| 61 | 61 | // we will now return a Promise that resolves once both the email and identity |
| 62 | 62 | // data have been resolved and the email has been mapped into the identity data. |
| 63 | - $promise = $this->getEmail($token)->then(function ($email) use ($token, $promise) { |
|
| 63 | + $promise = $this->getEmail($token)->then(function($email) use ($token, $promise) { |
|
| 64 | 64 | |
| 65 | 65 | // Map the email in once the identity data is available (has succesfully resolved). |
| 66 | - return $promise->then(function (array $data) use ($token, $email) { |
|
| 66 | + return $promise->then(function(array $data) use ($token, $email) { |
|
| 67 | 67 | |
| 68 | 68 | $data['email'] = $email ?? $data['email']; |
| 69 | 69 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | }); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return $promise->then(function (array $data) use ($token) { |
|
| 75 | + return $promise->then(function(array $data) use ($token) { |
|
| 76 | 76 | return $this->createIdentity($token, $data); |
| 77 | 77 | }); |
| 78 | 78 | } |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | // Intercept the flow - instead of directly returning a Promise for the entity's identity data, |
| 56 | 56 | // we will now return a Promise that resolves once both the email and identity |
| 57 | 57 | // data have been resolved and the email has been mapped into the identity data. |
| 58 | - $promise = $this->getEmail($token)->then(function ($email) use ($token, $promise) { |
|
| 58 | + $promise = $this->getEmail($token)->then(function($email) use ($token, $promise) { |
|
| 59 | 59 | |
| 60 | 60 | // Map the e-mail address in once the identity data is available (has successfully resolved). |
| 61 | - return $promise->then(function (array $data) use ($token, $email) { |
|
| 61 | + return $promise->then(function(array $data) use ($token, $email) { |
|
| 62 | 62 | |
| 63 | 63 | $data['email'] = $email ?? $data['email']; |
| 64 | 64 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | }); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - return $promise->then(function (array $data) use ($token) { |
|
| 70 | + return $promise->then(function(array $data) use ($token) { |
|
| 71 | 71 | return $this->createIdentity($token, $data); |
| 72 | 72 | }); |
| 73 | 73 | } |
@@ -38,9 +38,9 @@ |
||
| 38 | 38 | public function getIdentifyUrl() : string |
| 39 | 39 | { |
| 40 | 40 | $fields = [ |
| 41 | - 'id', 'first-name', 'last-name', 'formatted-name', |
|
| 42 | - 'email-address', 'headline', 'location', 'industry', |
|
| 43 | - 'public-profile-url', 'picture-url', |
|
| 41 | + 'id', 'first-name', 'last-name', 'formatted-name', |
|
| 42 | + 'email-address', 'headline', 'location', 'industry', |
|
| 43 | + 'public-profile-url', 'picture-url', |
|
| 44 | 44 | ]; |
| 45 | 45 | |
| 46 | 46 | // Talk about proprietary 'standards'... |