More codestandards.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-06-12 09:30:10 +00:00
parent d0270b00ca
commit 0f3bbf1f47
8 changed files with 124 additions and 42 deletions

32
src/Notification/Ntfy.php Normal file
View File

@ -0,0 +1,32 @@
<?php
namespace App\Notification;
use Ntfy\Server;
use Ntfy\Message;
use Ntfy\Client;
class Ntfy implements NotificationInterface
{
private array $config;
private \Ntfy\Server $server;
private \Ntfy\Client $client;
public function __construct(array $config)
{
$this->config = $config;
$this->server = new Server($config['domain']);
$this->client = new Client($this->server);
}
public function send(string $title, string $message): void
{
$msg = new Message();
$msg->topic($this->config['topic']);
$msg->title($title);
$msg->body($message);
$this->client->send($msg);
}
}