@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $this->deleteStoredData($name); |
36 | 36 | } |
37 | 37 | |
38 | - $this->getStorage()->set($this->providerId . '.' . $name, $value); |
|
38 | + $this->getStorage()->set($this->providerId.'.'.$name, $value); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | protected function getStoredData($name) |
53 | 53 | { |
54 | - return $this->getStorage()->get($this->providerId . '.' . $name); |
|
54 | + return $this->getStorage()->get($this->providerId.'.'.$name); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected function deleteStoredData($name) |
63 | 63 | { |
64 | - $this->getStorage()->delete($this->providerId . '.' . $name); |
|
64 | + $this->getStorage()->delete($this->providerId.'.'.$name); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -69,6 +69,6 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function clearStoredData() |
71 | 71 | { |
72 | - $this->getStorage()->deleteMatch($this->providerId . '.'); |
|
72 | + $this->getStorage()->deleteMatch($this->providerId.'.'); |
|
73 | 73 | } |
74 | 74 | } |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | { |
30 | 30 | $data = $this->parseJson($raw); |
31 | 31 | |
32 | - if (!$data) { |
|
32 | + if ( ! $data) { |
|
33 | 33 | $data = $this->parseXml($raw); |
34 | 34 | |
35 | - if (!$data) { |
|
35 | + if ( ! $data) { |
|
36 | 36 | $data = $this->parseQueryString($raw); |
37 | 37 | } |
38 | 38 | } |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | |
69 | 69 | libxml_use_internal_errors(false); |
70 | 70 | |
71 | - if (!$xml) { |
|
71 | + if ( ! $xml) { |
|
72 | 72 | return []; |
73 | 73 | } |
74 | 74 | |
75 | - $arr = json_decode(json_encode((array)$xml), true); |
|
75 | + $arr = json_decode(json_encode((array) $xml), true); |
|
76 | 76 | $arr = array($xml->getName() => $arr); |
77 | 77 | |
78 | 78 | return $arr; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | parse_str($result, $output); |
91 | 91 | |
92 | - if (!is_array($output)) { |
|
92 | + if ( ! is_array($output)) { |
|
93 | 93 | return $result; |
94 | 94 | } |
95 | 95 |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function request($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) |
115 | 115 | { |
116 | - $this->requestHeader = array_replace($this->requestHeader, (array)$headers); |
|
116 | + $this->requestHeader = array_replace($this->requestHeader, (array) $headers); |
|
117 | 117 | |
118 | 118 | $this->requestArguments = [ |
119 | 119 | 'uri' => $uri, |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $this->responseClientError = $e->getMessage(); |
171 | 171 | } |
172 | 172 | |
173 | - if (!$this->responseClientError) { |
|
173 | + if ( ! $this->responseClientError) { |
|
174 | 174 | $this->responseBody = $response->getBody(); |
175 | 175 | $this->responseHttpCode = $response->getStatusCode(); |
176 | 176 | $this->responseHeader = $response->getHeaders(); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function request($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) |
106 | 106 | { |
107 | - $this->requestHeader = array_replace($this->requestHeader, (array)$headers); |
|
107 | + $this->requestHeader = array_replace($this->requestHeader, (array) $headers); |
|
108 | 108 | |
109 | 109 | $this->requestArguments = [ |
110 | 110 | 'uri' => $uri, |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | unset($this->curlOptions[CURLOPT_POST]); |
122 | 122 | unset($this->curlOptions[CURLOPT_POSTFIELDS]); |
123 | 123 | |
124 | - $uri = $uri . (strpos($uri, '?') ? '&' : '?') . http_build_query($parameters); |
|
124 | + $uri = $uri.(strpos($uri, '?') ? '&' : '?').http_build_query($parameters); |
|
125 | 125 | if ($method === 'DELETE') { |
126 | 126 | $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'DELETE'; |
127 | 127 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | { |
286 | 286 | $pos = strpos($header, ':'); |
287 | 287 | |
288 | - if (!empty($pos)) { |
|
288 | + if ( ! empty($pos)) { |
|
289 | 289 | $key = str_replace('-', '_', strtolower(substr($header, 0, $pos))); |
290 | 290 | |
291 | 291 | $value = trim(substr($header, $pos + 2)); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $headers = []; |
307 | 307 | |
308 | 308 | foreach ($this->requestHeader as $header => $value) { |
309 | - $headers[] = trim($header) . ': ' . trim($value); |
|
309 | + $headers[] = trim($header).': '.trim($value); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | return $headers; |
@@ -93,8 +93,8 @@ |
||
93 | 93 | $protocol = 'https://'; |
94 | 94 | } |
95 | 95 | |
96 | - return $protocol . |
|
97 | - $collection->get('HTTP_HOST') . |
|
96 | + return $protocol. |
|
97 | + $collection->get('HTTP_HOST'). |
|
98 | 98 | $collection->get($requestUri ? 'REQUEST_URI' : 'PHP_SELF'); |
99 | 99 | } |
100 | 100 | } |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | ]; |
55 | 55 | |
56 | 56 | $this->tokenExchangeHeaders = [ |
57 | - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) |
|
57 | + 'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret) |
|
58 | 58 | ]; |
59 | 59 | |
60 | 60 | $this->tokenRefreshHeaders = [ |
61 | - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) |
|
61 | + 'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret) |
|
62 | 62 | ]; |
63 | 63 | } |
64 | 64 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $response = $this->apiRequest('v1/identity/oauth2/userinfo', 'GET', $parameters, $headers); |
82 | 82 | $data = new Data\Collection($response); |
83 | 83 | |
84 | - if (!$data->exists('user_id')) { |
|
84 | + if ( ! $data->exists('user_id')) { |
|
85 | 85 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
86 | 86 | } |
87 | 87 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | $data = new Data\Collection($response); |
53 | 53 | |
54 | - if (!$data->exists('id')) { |
|
54 | + if ( ! $data->exists('id')) { |
|
55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
56 | 56 | } |
57 | 57 |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function getUserProfile() |
59 | 59 | { |
60 | - $response = $this->apiRequest($this->getStoredData('orcid') . '/record'); |
|
60 | + $response = $this->apiRequest($this->getStoredData('orcid').'/record'); |
|
61 | 61 | $data = new Data\Collection($response['record']); |
62 | 62 | |
63 | - if (!$data->exists('orcid-identifier')) { |
|
63 | + if ( ! $data->exists('orcid-identifier')) { |
|
64 | 64 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
65 | 65 | } |
66 | 66 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | if ($data->exists('credit-name')) { |
153 | 153 | $profile->displayName = $data->get('credit-name'); |
154 | 154 | } else { |
155 | - $profile->displayName = $data->get('given-names') . ' ' . $data->get('family-name'); |
|
155 | + $profile->displayName = $data->get('given-names').' '.$data->get('family-name'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $profile->firstName = $data->get('given-names'); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $data = new Data\Collection($data->get('emails')); |
176 | 176 | $data = new Data\Collection($data->get('email')); |
177 | 177 | |
178 | - if (!$data->exists(0)) { |
|
178 | + if ( ! $data->exists(0)) { |
|
179 | 179 | $email = $data; |
180 | 180 | } else { |
181 | 181 | $email = new Data\Collection($data->get(0)); |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | $data = new Data\Collection($response); |
57 | 57 | |
58 | - if (!$data->exists('uuid')) { |
|
58 | + if ( ! $data->exists('uuid')) { |
|
59 | 59 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
60 | 60 | } |
61 | 61 | |
62 | 62 | $userProfile = new User\Profile(); |
63 | 63 | |
64 | 64 | $userProfile->identifier = $data->get('uuid'); |
65 | - $userProfile->profileURL = 'https://bitbucket.org/' . $data->get('username') . '/'; |
|
65 | + $userProfile->profileURL = 'https://bitbucket.org/'.$data->get('username').'/'; |
|
66 | 66 | $userProfile->displayName = $data->get('display_name'); |
67 | 67 | $userProfile->email = $data->get('email'); |
68 | 68 | $userProfile->webSiteURL = $data->get('website'); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | $response = $this->apiRequest('user/emails'); |
96 | 96 | |
97 | 97 | foreach ($response->values as $idx => $item) { |
98 | - if (!empty($item->is_primary) && $item->is_primary == true) { |
|
98 | + if ( ! empty($item->is_primary) && $item->is_primary == true) { |
|
99 | 99 | $userProfile->email = $item->email; |
100 | 100 | |
101 | - if (!empty($item->is_confirmed) && $item->is_confirmed == true) { |
|
101 | + if ( ! empty($item->is_confirmed) && $item->is_confirmed == true) { |
|
102 | 102 | $userProfile->emailVerified = $userProfile->email; |
103 | 103 | } |
104 | 104 |