fix: return type and typing on send
This commit is contained in:
parent
f4f7373272
commit
dcf8c28f1a
@ -3,22 +3,24 @@
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Models\Quote;
|
||||
use Illuminate\Http\Client\Response;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class Slack
|
||||
{
|
||||
private string $url;
|
||||
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = config('bot.webhook');
|
||||
}
|
||||
|
||||
private function send($text): \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response
|
||||
private function send(string $text): Response
|
||||
{
|
||||
return Http::post($this->url, ['text' => $text]);
|
||||
}
|
||||
|
||||
public function sendText(string $text): \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response
|
||||
public function sendText(string $text): Response
|
||||
{
|
||||
activity()
|
||||
->event('send')
|
||||
@ -27,7 +29,7 @@ class Slack
|
||||
return $this->send($text);
|
||||
}
|
||||
|
||||
public function sendQuote(Quote $quote): \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response
|
||||
public function sendQuote(Quote $quote): Response
|
||||
{
|
||||
activity()
|
||||
->performedOn($quote)
|
||||
|
||||
Reference in New Issue
Block a user