Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
assert6 committed May 7, 2019
1 parent 1d35ec0 commit 2103f4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 6 additions & 1 deletion src/AbstractRobot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2103f4d

Please sign in to comment.