@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { |
| 10 | 10 | public function send($message, $username = null, $emoji = null, $channel = null) |
| 11 | 11 | { |
| 12 | - if (! config('slack.incoming-webhook')) { |
|
| 12 | + if (!config('slack.incoming-webhook')) { |
|
| 13 | 13 | return; |
| 14 | 14 | } |
| 15 | 15 | |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | $channel = trim($channel); |
| 18 | 18 | $username = trim($username); |
| 19 | 19 | |
| 20 | - $payload['text'] = $message; |
|
| 21 | - $payload['username'] = empty($username) ? config('slack.default_username') : $username; |
|
| 22 | - $payload['icon_emoji'] = empty($emoji) ? config('slack.default_emoji') : $emoji; |
|
| 23 | - $payload['channel'] = $channel; |
|
| 20 | + $payload[ 'text' ] = $message; |
|
| 21 | + $payload[ 'username' ] = empty($username) ? config('slack.default_username') : $username; |
|
| 22 | + $payload[ 'icon_emoji' ] = empty($emoji) ? config('slack.default_emoji') : $emoji; |
|
| 23 | + $payload[ 'channel' ] = $channel; |
|
| 24 | 24 | |
| 25 | 25 | $headers = [ |
| 26 | 26 | 'Content-Type' => 'application/json', |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function testFailedSlackRequestWithEmptyMessage() |
| 14 | 14 | { |
| 15 | - Slack::send(); |
|
| 15 | + Slack::send(); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | public function testFailedSlackRequestWithWrongEndpoint() |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | public function testSuccessfulSlackRequest() |
| 27 | 27 | { |
| 28 | - config(['slack.incoming-webhook' => env('SAMPLE_WEBHOOK')]); |
|
| 28 | + config(['slack.incoming-webhook' => env('SAMPLE_WEBHOOK')]); |
|
| 29 | 29 | |
| 30 | - $response = Slack::send('hi'); |
|
| 30 | + $response = Slack::send('hi'); |
|
| 31 | 31 | |
| 32 | - $this->assertEquals(200, $response->getStatusCode()); |
|
| 32 | + $this->assertEquals(200, $response->getStatusCode()); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function testSuccessfulSlackRequest() |
| 27 | 27 | { |
| 28 | - config(['slack.incoming-webhook' => env('SAMPLE_WEBHOOK')]); |
|
| 28 | + config([ 'slack.incoming-webhook' => env('SAMPLE_WEBHOOK') ]); |
|
| 29 | 29 | |
| 30 | 30 | $response = Slack::send('hi'); |
| 31 | 31 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { |
| 10 | 10 | protected function getPackageProviders($app) |
| 11 | 11 | { |
| 12 | - return [SlackServiceProvider::class]; |
|
| 12 | + return [ SlackServiceProvider::class ]; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | protected function getPackageAliases($app) |
@@ -21,6 +21,6 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | protected function getEnvironmentSetUp($app) |
| 23 | 23 | { |
| 24 | - $app['config']['slack'] = require __DIR__ . '/../config/slack.php'; |
|
| 24 | + $app[ 'config' ][ 'slack' ] = require __DIR__.'/../config/slack.php'; |
|
| 25 | 25 | } |
| 26 | 26 | } |