Quality of life. Removing a lot of requirements etc
This commit is contained in:
@@ -7,7 +7,7 @@ namespace App\Notification;
|
||||
use App\Notification\Ntfy;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
class Notification
|
||||
final class Notification
|
||||
{
|
||||
/**
|
||||
* @var NotificationInterface[] $notifiers
|
||||
|
||||
@@ -12,7 +12,7 @@ use InvalidArgumentException;
|
||||
/**
|
||||
* Send a notification through a ntfy server
|
||||
*/
|
||||
class Ntfy implements NotificationInterface
|
||||
final class Ntfy implements NotificationInterface
|
||||
{
|
||||
public const int TOPIC_MAX_LENGTH = 256;
|
||||
public const int TITLE_MAX_LENGTH = 256;
|
||||
@@ -26,6 +26,7 @@ class Ntfy implements NotificationInterface
|
||||
*
|
||||
* @param string[] $config Configuration
|
||||
*/
|
||||
#[\Override]
|
||||
public static function factory(array $config): self
|
||||
{
|
||||
$instance = new self(new Client(new Server($config['domain'])));
|
||||
@@ -64,6 +65,7 @@ class Ntfy implements NotificationInterface
|
||||
/**
|
||||
* Push a message with Ntfy
|
||||
*/
|
||||
#[\Override]
|
||||
public function send(string $title, string $message): void
|
||||
{
|
||||
if (! strlen($title) || strlen($title) > self::TITLE_MAX_LENGTH) {
|
||||
|
||||
Reference in New Issue
Block a user