mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 15:23:12 +08:00
Renamed MercureUpdatesGenerator to PublishingUpdatesGenerator to make it general purpose
This commit is contained in:
@@ -9,14 +9,14 @@ use Psr\Log\LoggerInterface;
|
||||
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
||||
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
||||
use Shlinkio\Shlink\Core\EventDispatcher\Event\ShortUrlCreated;
|
||||
use Shlinkio\Shlink\Core\Mercure\MercureUpdatesGeneratorInterface;
|
||||
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
||||
use Throwable;
|
||||
|
||||
class NotifyNewShortUrlToMercure
|
||||
{
|
||||
public function __construct(
|
||||
private readonly PublishingHelperInterface $mercureHelper,
|
||||
private readonly MercureUpdatesGeneratorInterface $updatesGenerator,
|
||||
private readonly PublishingUpdatesGeneratorInterface $updatesGenerator,
|
||||
private readonly EntityManagerInterface $em,
|
||||
private readonly LoggerInterface $logger,
|
||||
) {
|
||||
|
||||
@@ -10,7 +10,7 @@ use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
||||
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
||||
use Shlinkio\Shlink\Core\Entity\Visit;
|
||||
use Shlinkio\Shlink\Core\EventDispatcher\Event\VisitLocated;
|
||||
use Shlinkio\Shlink\Core\Mercure\MercureUpdatesGeneratorInterface;
|
||||
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
||||
use Throwable;
|
||||
|
||||
use function Functional\each;
|
||||
@@ -19,7 +19,7 @@ class NotifyVisitToMercure
|
||||
{
|
||||
public function __construct(
|
||||
private readonly PublishingHelperInterface $mercureHelper,
|
||||
private readonly MercureUpdatesGeneratorInterface $updatesGenerator,
|
||||
private readonly PublishingUpdatesGeneratorInterface $updatesGenerator,
|
||||
private readonly EntityManagerInterface $em,
|
||||
private readonly LoggerInterface $logger,
|
||||
) {
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Mercure;
|
||||
namespace Shlinkio\Shlink\Core\EventDispatcher;
|
||||
|
||||
use Shlinkio\Shlink\Common\Rest\DataTransformerInterface;
|
||||
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
||||
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
||||
use Shlinkio\Shlink\Core\Entity\Visit;
|
||||
use Shlinkio\Shlink\Core\EventDispatcher\Topic;
|
||||
|
||||
// TODO This class can now be use in an agnostic way on all listeners
|
||||
final class MercureUpdatesGenerator implements MercureUpdatesGeneratorInterface
|
||||
final class PublishingUpdatesGenerator implements PublishingUpdatesGeneratorInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DataTransformerInterface $shortUrlTransformer,
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Mercure;
|
||||
namespace Shlinkio\Shlink\Core\EventDispatcher;
|
||||
|
||||
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
||||
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
||||
use Shlinkio\Shlink\Core\Entity\Visit;
|
||||
|
||||
interface MercureUpdatesGeneratorInterface
|
||||
interface PublishingUpdatesGeneratorInterface
|
||||
{
|
||||
public function newVisitUpdate(Visit $visit): Update;
|
||||
|
||||
@@ -11,7 +11,6 @@ class OrphanVisitDataTransformer implements DataTransformerInterface
|
||||
{
|
||||
/**
|
||||
* @param Visit $visit
|
||||
* @return array
|
||||
*/
|
||||
public function transform($visit): array // phpcs:ignore
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user