@@ -26,26 +26,26 @@ |
||
26 | 26 | * |
27 | 27 | * @return string|null |
28 | 28 | */ |
29 | - public function getUsername() : ?string; |
|
29 | + public function getUsername() : ? string; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Returns the full name bound to the Identity. |
33 | 33 | * |
34 | 34 | * @return string|null |
35 | 35 | */ |
36 | - public function getName() : ?string; |
|
36 | + public function getName() : ? string; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Returns the e-mail address bound to the Identity. |
40 | 40 | * |
41 | 41 | * @return string|null |
42 | 42 | */ |
43 | - public function getEmail() : ?string; |
|
43 | + public function getEmail() : ? string; |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Returns the avatar URI bound to the Identity. |
47 | 47 | * |
48 | 48 | * @return string|null |
49 | 49 | */ |
50 | - public function getAvatar() : ?string; |
|
50 | + public function getAvatar() : ? string; |
|
51 | 51 | } |
@@ -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 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * {@inheritDoc} |
89 | 89 | */ |
90 | - public function getUsername() : ?string |
|
90 | + public function getUsername() : ? string |
|
91 | 91 | { |
92 | 92 | return $this->username; |
93 | 93 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * {@inheritDoc} |
97 | 97 | */ |
98 | - public function getName() : ?string |
|
98 | + public function getName() : ? string |
|
99 | 99 | { |
100 | 100 | return $this->name; |
101 | 101 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * {@inheritDoc} |
105 | 105 | */ |
106 | - public function getEmail() : ?string |
|
106 | + public function getEmail() : ? string |
|
107 | 107 | { |
108 | 108 | return $this->email; |
109 | 109 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * {@inheritDoc} |
113 | 113 | */ |
114 | - public function getAvatar() : ?string |
|
114 | + public function getAvatar() : ? string |
|
115 | 115 | { |
116 | 116 | return $this->avatar; |
117 | 117 | } |
@@ -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 | } |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | // Intercept the flow - instead of directly returning a Promise for the entity's identity data, |
51 | 51 | // we will now return a Promise that resolves once both the email and identity |
52 | 52 | // data have been resolved and the email has been mapped into the identity data. |
53 | - $promise = $this->getEmail($token)->then(function ($email) use ($token, $promise) { |
|
53 | + $promise = $this->getEmail($token)->then(function($email) use ($token, $promise) { |
|
54 | 54 | |
55 | 55 | // Map the e-mail address in once the identity data is available (has successfully resolved). |
56 | - return $promise->then(function (array $data) use ($token, $email) { |
|
56 | + return $promise->then(function(array $data) use ($token, $email) { |
|
57 | 57 | |
58 | 58 | $data['email'] = $email ?? $data['email']; |
59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | }); |
63 | 63 | } |
64 | 64 | |
65 | - return $promise->then(function (array $data) use ($token) { |
|
65 | + return $promise->then(function(array $data) use ($token) { |
|
66 | 66 | return $this->createIdentity($token, $data); |
67 | 67 | }); |
68 | 68 | } |
@@ -43,9 +43,9 @@ |
||
43 | 43 | public function getIdentifyUrl() : string |
44 | 44 | { |
45 | 45 | $fields = [ |
46 | - 'id', 'first-name', 'last-name', 'formatted-name', |
|
47 | - 'email-address', 'headline', 'location', 'industry', |
|
48 | - 'public-profile-url', 'picture-url', |
|
46 | + 'id', 'first-name', 'last-name', 'formatted-name', |
|
47 | + 'email-address', 'headline', 'location', 'industry', |
|
48 | + 'public-profile-url', 'picture-url', |
|
49 | 49 | ]; |
50 | 50 | |
51 | 51 | // Talk about proprietary 'standards'... |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | // Intercept the flow - instead of directly returning a Promise for the entity's identity data, |
51 | 51 | // we will now return a Promise that resolves once both the email and identity |
52 | 52 | // data have been resolved and the email has been mapped into the identity data. |
53 | - $promise = $this->getEmail($token)->then(function ($email) use ($token, $promise) { |
|
53 | + $promise = $this->getEmail($token)->then(function($email) use ($token, $promise) { |
|
54 | 54 | |
55 | 55 | // Map the e-mail address in once the identity data is available (has successfully resolved). |
56 | - return $promise->then(function (array $data) use ($token, $email) { |
|
56 | + return $promise->then(function(array $data) use ($token, $email) { |
|
57 | 57 | |
58 | 58 | $data['email'] = $email ?? $data['email']; |
59 | 59 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | }); |
63 | 63 | } |
64 | 64 | |
65 | - return $promise->then(function (array $data) use ($token) { |
|
65 | + return $promise->then(function(array $data) use ($token) { |
|
66 | 66 | return $this->createIdentity($token, $data); |
67 | 67 | }); |
68 | 68 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | public function request(string $method, string $url, auth\interfaces\Token $token = null, array $options = []) : Promise |
109 | 109 | { |
110 | 110 | return $this->getHttpClient()->requestAsync($method, $url, array_merge_recursive($this->getDefaultRequestOptions($token), $options))->then( |
111 | - function (Response $response) use($token) { |
|
111 | + function(Response $response) use($token) { |
|
112 | 112 | return $this->onRequestSuccess($response, $token); |
113 | 113 | }, |
114 | 114 | function(\Exception $exception) use($token) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'grant_type' => 'authorization_code', |
71 | 71 | 'code' => $code |
72 | 72 | ] |
73 | - ])->then(function (array $data) { |
|
73 | + ])->then(function(array $data) { |
|
74 | 74 | return $this->createToken($data); |
75 | 75 | }); |
76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function identify(oauth2\Token $token) : Promise |
82 | 82 | { |
83 | - return $this->request('GET', $this->getIdentifyUrl(), $token)->then(function (array $data) use ($token) { |
|
83 | + return $this->request('GET', $this->getIdentifyUrl(), $token)->then(function(array $data) use ($token) { |
|
84 | 84 | return $this->createIdentity($token, $data); |
85 | 85 | }); |
86 | 86 | } |