fix: return type and typing on send

This commit is contained in:
Nicholas Ciechanowski 2023-10-28 22:47:32 +11:00
parent f4f7373272
commit dcf8c28f1a

View File

@ -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)