@@ -13,7 +13,7 @@ |
||
13 | 13 | * @param mixed $Slack |
14 | 14 | * @return void |
15 | 15 | */ |
16 | - public function __construct( \Sreedev\Slack\Slack $Slack, $method, $data) |
|
16 | + public function __construct(\Sreedev\Slack\Slack $Slack, $method, $data) |
|
17 | 17 | { |
18 | 18 | parent::__construct($Slack, $method, $data, $this->functionSet); |
19 | 19 | } |
@@ -16,14 +16,14 @@ |
||
16 | 16 | /** |
17 | 17 | * Export the config file |
18 | 18 | * php artisan vendor:publish --provider="Sreedev\Slack\SlackServiceProvider" --tag="config" |
19 | - **/ |
|
19 | + **/ |
|
20 | 20 | if ($this->app->runningInConsole()) { |
21 | 21 | |
22 | 22 | $this->publishes([ |
23 | - __DIR__.'/../config/config.php' => config_path('slack.php'), |
|
23 | + __DIR__.'/../config/config.php' => config_path('slack.php'), |
|
24 | 24 | ], 'config'); |
25 | 25 | |
26 | - } |
|
26 | + } |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function register() |
35 | 35 | { |
36 | - $this->app->singleton('slack', function($app){ |
|
36 | + $this->app->singleton('slack', function($app) { |
|
37 | 37 | return new Slack(config("slack.SLACK_API_TOKEN")); |
38 | 38 | }); |
39 | 39 | $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'slack'); |
@@ -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; |