Moved Mercure and RabbitMq event listeners to their own subnamespaces

This commit is contained in:
Alejandro Celaya
2022-07-21 20:07:28 +02:00
parent 1aa9ae680e
commit f832c56adb
8 changed files with 70 additions and 15 deletions

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher\Event;
use JsonSerializable;
final class ShortUrlCreated implements JsonSerializable
{
public function __construct(public readonly string $shortUrlId)
{
}
public function jsonSerialize(): array
{
return [
'shortUrlId' => $this->shortUrlId,
];
}
}

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher\Mercure;
use Shlinkio\Shlink\Core\EventDispatcher\Event\ShortUrlCreated;
class NotifyNewShortUrlToMercure
{
public function __invoke(ShortUrlCreated $shortUrlCreated)
{
// TODO: Implement __invoke() method.
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher;
namespace Shlinkio\Shlink\Core\EventDispatcher\Mercure;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher\RabbitMq;
use Shlinkio\Shlink\Core\EventDispatcher\Event\ShortUrlCreated;
class NotifyNewShortUrlToRabbitMq
{
public function __invoke(ShortUrlCreated $shortUrlCreated)
{
// TODO: Implement __invoke() method.
}
}

View File

@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher;
namespace Shlinkio\Shlink\Core\EventDispatcher\RabbitMq;
use Doctrine\ORM\EntityManagerInterface;
use PhpAmqpLib\Connection\AMQPStreamConnection;