Extracted real-time update topic names to an enum

This commit is contained in:
Alejandro Celaya
2022-07-24 12:05:55 +02:00
parent fc6b4c12b2
commit 4d1af867a4
4 changed files with 29 additions and 18 deletions

View File

@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher;
use function sprintf;
enum Topic: string
{
case NEW_VISIT = 'https://shlink.io/new-visit';
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 $shortCode): string
{
return sprintf('%s/%s', self::NEW_VISIT->value, $shortCode ?? '');
}
}