@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | $this->Slack = $Slack; |
39 | 39 | $this->setfunctionSet($functionSet); |
40 | - $json = file_get_contents(__DIR__. '/Slack.json'); |
|
40 | + $json = file_get_contents(__DIR__.'/Slack.json'); |
|
41 | 41 | $this->endPoints = json_decode($json, true); |
42 | 42 | return $this->sendRequest($method, $data); |
43 | 43 | } |
@@ -62,16 +62,16 @@ |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | - /** |
|
66 | - * Performs the underlying HTTP request. Not very exciting. |
|
67 | - * |
|
68 | - * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete |
|
69 | - * @param string $method The API method to be called |
|
70 | - * @param array $args Assoc array of parameters to be passed |
|
71 | - * @param int $timeout |
|
72 | - * |
|
73 | - * @return array|false Assoc array of decoded result |
|
74 | - */ |
|
65 | + /** |
|
66 | + * Performs the underlying HTTP request. Not very exciting. |
|
67 | + * |
|
68 | + * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete |
|
69 | + * @param string $method The API method to be called |
|
70 | + * @param array $args Assoc array of parameters to be passed |
|
71 | + * @param int $timeout |
|
72 | + * |
|
73 | + * @return array|false Assoc array of decoded result |
|
74 | + */ |
|
75 | 75 | public function makeRequest($http_verb, $method, $args = array(), $timeout = self::TIMEOUT) |
76 | 76 | { |
77 | 77 | if( $this->api_token == '') |
@@ -74,22 +74,22 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function makeRequest($http_verb, $method, $args = array(), $timeout = self::TIMEOUT) |
76 | 76 | { |
77 | - if( $this->api_token == '') |
|
77 | + if ($this->api_token == '') |
|
78 | 78 | { |
79 | 79 | throw new Exception('\Exception'); |
80 | 80 | } |
81 | - $url = $this->api_endpoint . '/' . $method; |
|
81 | + $url = $this->api_endpoint.'/'.$method; |
|
82 | 82 | |
83 | 83 | $response = $this->prepareStateForRequest($http_verb, $method, $url, $timeout); |
84 | 84 | |
85 | 85 | $httpHeader = array( |
86 | 86 | 'Content-type: application/json', |
87 | - 'Authorization: Bearer '. $this->api_token |
|
87 | + 'Authorization: Bearer '.$this->api_token |
|
88 | 88 | ); |
89 | 89 | |
90 | 90 | |
91 | 91 | if (isset($args["language"])) { |
92 | - $httpHeader[] = "Accept-Language: " . $args["language"]; |
|
92 | + $httpHeader[] = "Accept-Language: ".$args["language"]; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | if ($http_verb === 'put') { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | case 'GET': |
118 | 118 | $query = http_build_query($args, '', '&'); |
119 | - curl_setopt($ch, CURLOPT_URL, $url . '?' . $query); |
|
119 | + curl_setopt($ch, CURLOPT_URL, $url.'?'.$query); |
|
120 | 120 | break; |
121 | 121 | |
122 | 122 | case 'DELETE': |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | private function findHTTPStatus($response, $formattedResponse) |
346 | 346 | { |
347 | 347 | if (!empty($response['headers']) && isset($response['headers']['http_code'])) { |
348 | - return (int)$response['headers']['http_code']; |
|
348 | + return (int) $response['headers']['http_code']; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | if (!empty($response['body']) && isset($formattedResponse['status'])) { |
352 | - return (int)$formattedResponse['status']; |
|
352 | + return (int) $formattedResponse['status']; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | return 418; |