mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Extracted real-time update topic names to an enum
This commit is contained in:
19
module/Core/src/EventDispatcher/Topic.php
Normal file
19
module/Core/src/EventDispatcher/Topic.php
Normal 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 ?? '');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user