Support for PHP infection testing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-11-03 13:29:50 +00:00
parent 66ccb3d8d6
commit bedc666f7c
11 changed files with 115 additions and 30 deletions

View File

@ -14,8 +14,9 @@ use InvalidArgumentException;
*/
class Ntfy implements NotificationInterface
{
const TOPIC_MAX_LENGTH = 256;
const MESSAGE_MAX_LENGTH = 4096;
public const TOPIC_MAX_LENGTH = 256;
public const TITLE_MAX_LENGTH = 256;
public const MESSAGE_MAX_LENGTH = 4096;
private string $topic = 'default';
/**
@ -68,7 +69,7 @@ class Ntfy implements NotificationInterface
*/
public function send(string $title, string $message): void
{
if (!strlen($title) || strlen($title) > self::TOPIC_MAX_LENGTH) {
if (!strlen($title) || strlen($title) > self::TITLE_MAX_LENGTH) {
throw new InvalidArgumentException("Invalid title length");
}