mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-08 00:03:12 +08:00
Allow individual real-time updates topics to be enabled
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user