Quality of life things.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Build and test / requirements (push) Failing after 3m48s

This commit is contained in:
2024-02-07 11:00:08 +00:00
parent aed385f5e0
commit 6ce774236e
18 changed files with 226 additions and 1885 deletions

View File

@ -35,9 +35,6 @@ class Ntfy implements NotificationInterface
return $instance;
}
/**
* @todo The constructor should be private but static code analysis complains.
*/
public function __construct(private Client $client)
{
}
@ -49,7 +46,7 @@ class Ntfy implements NotificationInterface
*/
public function setTopic(string $topic): void
{
if (!strlen($topic) || strlen($topic) > self::TOPIC_MAX_LENGTH) {
if (! strlen($topic) || strlen($topic) > self::TOPIC_MAX_LENGTH) {
throw new InvalidArgumentException("Invalid topic length");
}
@ -69,11 +66,11 @@ class Ntfy implements NotificationInterface
*/
public function send(string $title, string $message): void
{
if (!strlen($title) || strlen($title) > self::TITLE_MAX_LENGTH) {
if (! strlen($title) || strlen($title) > self::TITLE_MAX_LENGTH) {
throw new InvalidArgumentException("Invalid title length");
}
if (!strlen($message) || strlen($message) > self::MESSAGE_MAX_LENGTH) {
if (! strlen($message) || strlen($message) > self::MESSAGE_MAX_LENGTH) {
throw new InvalidArgumentException("Invalid message length");
}