diff --git a/composer.json b/composer.json index ba67ad3..738b784 100644 --- a/composer.json +++ b/composer.json @@ -3,12 +3,12 @@ "require": { "php": ">=7.2", "ext-json": "*", - "guzzlehttp/guzzle": "^6.3", - "mockery/mockery": "^1.2" + "guzzlehttp/guzzle": "^6.3" }, "require-dev": { "phpunit/phpunit": "^7.0.0", - "friendsofphp/php-cs-fixer": "^2.9" + "friendsofphp/php-cs-fixer": "^2.9", + "mockery/mockery": "^1.2" }, "autoload": { "psr-4": { diff --git a/src/AbstractRobot.php b/src/AbstractRobot.php index 7d6c54f..992bf8c 100644 --- a/src/AbstractRobot.php +++ b/src/AbstractRobot.php @@ -27,10 +27,15 @@ public function send(AbstractMessage $message) { $response = $this->client->request('POST', $this->getWebhook(), [ 'json' => $message->format(), - ]); + ] + $this->getOptions()); return $this->afterSend($response); } + protected function getOptions() + { + return []; + } + protected function afterSend(ResponseInterface $response): array { return json_decode($response->getBody()->getContents(), true);