Quality of life. Removing a lot of requirements etc

This commit is contained in:
2025-02-28 13:57:22 +00:00
parent e074e00c43
commit 2070c11050
13 changed files with 25 additions and 2889 deletions

View File

@@ -7,7 +7,7 @@ namespace App\Notification;
use App\Notification\Ntfy;
use Psr\Log\NullLogger;
class Notification
final class Notification
{
/**
* @var NotificationInterface[] $notifiers

View File

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