Skip to content

Commit 63d7425

Browse files
committed
Coding Standards arrived
1 parent 8a5dc50 commit 63d7425

File tree

5 files changed

+36
-24
lines changed

5 files changed

+36
-24
lines changed

src/intercom/Exception/ClientErrorResponseException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
/**
66
* Exception when a client error is encountered (4xx codes)
77
*/
8-
class ClientErrorResponseException extends IntercomException {}
8+
class ClientErrorResponseException extends IntercomException
9+
{
10+
}

src/intercom/Exception/IntercomException.php

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class IntercomException extends BadResponseException
1919
* @param Response $response The response
2020
* @return BadResponseException
2121
*/
22-
public static function factory(RequestInterface $request, Response $response) {
22+
public static function factory(RequestInterface $request, Response $response)
23+
{
2324
if (!static::isValidIntercomError($response->json())) {
2425
$label = 'Unsuccessful response';
2526
$class = __CLASS__;
@@ -34,11 +35,14 @@ public static function factory(RequestInterface $request, Response $response) {
3435
$class = __CLASS__;
3536
}
3637

37-
$message = $label . PHP_EOL . implode(PHP_EOL, array(
38-
'[status code] ' . $response->getStatusCode(),
39-
'[reason phrase] ' . $response->getReasonPhrase(),
40-
'[url] ' . $request->getUrl(),
41-
));
38+
$message = $label . PHP_EOL . implode(
39+
PHP_EOL,
40+
array(
41+
'[status code] ' . $response->getStatusCode(),
42+
'[reason phrase] ' . $response->getReasonPhrase(),
43+
'[url] ' . $request->getUrl(),
44+
)
45+
);
4246

4347
$e = new $class($message);
4448
$e->setResponse($response);
@@ -57,11 +61,13 @@ public static function factory(RequestInterface $request, Response $response) {
5761
* @param $response_body
5862
* @return bool
5963
*/
60-
private function isValidIntercomError($response_body) {
64+
private function isValidIntercomError($response_body)
65+
{
6166
if (array_key_exists('type', $response_body) &&
6267
$response_body['type'] == 'error.list' &&
63-
array_key_exists('errors', $response_body)) {
64-
return true;
68+
array_key_exists('errors', $response_body)
69+
) {
70+
return true;
6571
}
6672
return false;
6773
}
@@ -71,7 +77,8 @@ private function isValidIntercomError($response_body) {
7177
*
7278
* @return array
7379
*/
74-
public function getErrors() {
80+
public function getErrors()
81+
{
7582
return $this->errors;
7683
}
7784
}

src/intercom/Exception/ServerErrorResponseException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
/**
66
* Exception when a server error is encountered (5xx codes)
77
*/
8-
class ServerErrorResponseException extends IntercomException {}
8+
class ServerErrorResponseException extends IntercomException
9+
{
10+
}

src/intercom/IntercomAbstractClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ abstract class IntercomAbstractClient extends Client
2222
*
2323
* @param Collection $config
2424
*/
25-
protected function configure($config) {
25+
protected function configure($config)
26+
{
2627
$this->setDefaultOption('headers', $config->get('headers'));
2728
$this->setDescription($this->getServiceDescriptionFromFile($config->get('service_description')));
2829
$this->setErrorHandler();

src/intercom/Service/config/intercom_v3_user.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,37 +212,37 @@
212212
"type": "object",
213213
"items": {
214214
"city_name": {
215-
"type" : "string"
215+
"type": "string"
216216
},
217217
"continent_code": {
218-
"type" : "string"
218+
"type": "string"
219219
},
220220
"country_code2": {
221-
"type" : "string"
221+
"type": "string"
222222
},
223223
"country_code3": {
224-
"type" : "string"
224+
"type": "string"
225225
},
226226
"id": {
227-
"type" : "string"
227+
"type": "string"
228228
},
229229
"latitude": {
230-
"type" : "integer"
230+
"type": "integer"
231231
},
232232
"longitude": {
233-
"type" : "integer"
233+
"type": "integer"
234234
},
235235
"postal_code": {
236-
"type" : "string"
236+
"type": "string"
237237
},
238238
"region_code": {
239-
"type" : "string"
239+
"type": "string"
240240
},
241241
"region_name": {
242-
"type" : "string"
242+
"type": "string"
243243
},
244244
"timezone": {
245-
"type" : "string"
245+
"type": "string"
246246
}
247247
}
248248
},

0 commit comments

Comments
 (0)