Allow individual real-time updates topics to be enabled

This commit is contained in:
Alejandro Celaya
2025-07-03 10:10:06 +02:00
parent 436be1985c
commit fb995f2bea
18 changed files with 137 additions and 13 deletions

View File

@@ -4,16 +4,23 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher;
use function Shlinkio\Shlink\Core\enumNames;
use function sprintf;
enum Topic: string
{
case NEW_VISIT = 'https://shlink.io/new-visit';
case NEW_SHORT_URL_VISIT = 'https://shlink.io/new-visit/%s';
case NEW_ORPHAN_VISIT = 'https://shlink.io/new-orphan-visit';
case NEW_SHORT_URL = 'https://shlink.io/new-short-url';
public static function newShortUrlVisit(string|null $shortCode): string
{
return sprintf('%s/%s', self::NEW_VISIT->value, $shortCode ?? '');
return sprintf(self::NEW_SHORT_URL_VISIT->value, $shortCode ?? '');
}
public static function allTopicNames(): array
{
return enumNames(self::class);
}
}