@@ -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'... |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @return string |
| 62 | 62 | */ |
| 63 | - public function getDescription() : ?string |
|
| 63 | + public function getDescription() : ? string |
|
| 64 | 64 | { |
| 65 | 65 | return $this->description; |
| 66 | 66 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return string |
| 72 | 72 | */ |
| 73 | - public function getLocation() : ?string |
|
| 73 | + public function getLocation() : ? string |
|
| 74 | 74 | { |
| 75 | 75 | return $this->location; |
| 76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @return int |
| 82 | 82 | */ |
| 83 | - public function getFollowersCount() : ?int |
|
| 83 | + public function getFollowersCount() : ? int |
|
| 84 | 84 | { |
| 85 | 85 | return $this->followersCount; |
| 86 | 86 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function apply($condition, callable $onMatch = null) : self |
| 61 | 61 | { |
| 62 | - if (!is_callable($condition)) { |
|
| 62 | + if (!is_callable($condition)) { |
|
| 63 | 63 | if (!$condition instanceof Condition) { |
| 64 | 64 | throw new \InvalidArgumentException('Expected a \nyx\diagnostics\Condition or a callable as first argument, got ['.diagnostics\Debug::getTypeName($condition).'] instead.'); |
| 65 | 65 | } |
@@ -156,7 +156,7 @@ |
||
| 156 | 156 | * |
| 157 | 157 | * @param string $name The name of the Event to emit {@see definitions/Events}. |
| 158 | 158 | * @param \Throwable $exception The initial Exception to be passed to listeners. |
| 159 | - * @return \Exception|null Either an Exception when event emission occurred or null if no Emitter |
|
| 159 | + * @return null|\Throwable Either an Exception when event emission occurred or null if no Emitter |
|
| 160 | 160 | * is set and therefore no events were emitted. |
| 161 | 161 | */ |
| 162 | 162 | protected function emitDebugEvent($name, \Throwable $exception) |