@@ -60,16 +60,16 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * Performs the underlying HTTP request. Not very exciting. |
|
| 65 | - * |
|
| 66 | - * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete |
|
| 67 | - * @param string $method The API method to be called |
|
| 68 | - * @param array $args Assoc array of parameters to be passed |
|
| 69 | - * @param int $timeout |
|
| 70 | - * |
|
| 71 | - * @return array|false Assoc array of decoded result |
|
| 72 | - */ |
|
| 63 | + /** |
|
| 64 | + * Performs the underlying HTTP request. Not very exciting. |
|
| 65 | + * |
|
| 66 | + * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete |
|
| 67 | + * @param string $method The API method to be called |
|
| 68 | + * @param array $args Assoc array of parameters to be passed |
|
| 69 | + * @param int $timeout |
|
| 70 | + * |
|
| 71 | + * @return array|false Assoc array of decoded result |
|
| 72 | + */ |
|
| 73 | 73 | public function makeRequest($http_verb, $method, $args = array(), $timeout = self::TIMEOUT) |
| 74 | 74 | { |
| 75 | 75 | $url = $this->api_endpoint . '/' . $method; |
@@ -72,18 +72,18 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function makeRequest($http_verb, $method, $args = array(), $timeout = self::TIMEOUT) |
| 74 | 74 | { |
| 75 | - $url = $this->api_endpoint . '/' . $method; |
|
| 75 | + $url = $this->api_endpoint.'/'.$method; |
|
| 76 | 76 | |
| 77 | 77 | $response = $this->prepareStateForRequest($http_verb, $method, $url, $timeout); |
| 78 | 78 | |
| 79 | 79 | $httpHeader = array( |
| 80 | 80 | 'Content-type: application/json', |
| 81 | - 'Authorization: Bearer '. $this->api_token |
|
| 81 | + 'Authorization: Bearer '.$this->api_token |
|
| 82 | 82 | ); |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | if (isset($args["language"])) { |
| 86 | - $httpHeader[] = "Accept-Language: " . $args["language"]; |
|
| 86 | + $httpHeader[] = "Accept-Language: ".$args["language"]; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | if ($http_verb === 'put') { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | case 'GET': |
| 112 | 112 | $query = http_build_query($args, '', '&'); |
| 113 | - curl_setopt($ch, CURLOPT_URL, $url . '?' . $query); |
|
| 113 | + curl_setopt($ch, CURLOPT_URL, $url.'?'.$query); |
|
| 114 | 114 | break; |
| 115 | 115 | |
| 116 | 116 | case 'DELETE': |
@@ -339,11 +339,11 @@ discard block |
||
| 339 | 339 | private function findHTTPStatus($response, $formattedResponse) |
| 340 | 340 | { |
| 341 | 341 | if (!empty($response['headers']) && isset($response['headers']['http_code'])) { |
| 342 | - return (int)$response['headers']['http_code']; |
|
| 342 | + return (int) $response['headers']['http_code']; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | if (!empty($response['body']) && isset($formattedResponse['status'])) { |
| 346 | - return (int)$formattedResponse['status']; |
|
| 346 | + return (int) $formattedResponse['status']; |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | return 418; |
@@ -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 | } |
@@ -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 | $this->sendRequest($method, $data); |
| 43 | 43 | } |
@@ -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'); |