mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Extracted logic to stringify ShortUrls to its own service
This commit is contained in:
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Core\Mercure;
|
||||
|
||||
use Shlinkio\Shlink\Common\Rest\DataTransformerInterface;
|
||||
use Shlinkio\Shlink\Core\Entity\Visit;
|
||||
use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer;
|
||||
use Symfony\Component\Mercure\Update;
|
||||
|
||||
use function json_encode;
|
||||
@@ -17,11 +17,11 @@ final class MercureUpdatesGenerator implements MercureUpdatesGeneratorInterface
|
||||
{
|
||||
private const NEW_VISIT_TOPIC = 'https://shlink.io/new-visit';
|
||||
|
||||
private ShortUrlDataTransformer $transformer;
|
||||
private DataTransformerInterface $transformer;
|
||||
|
||||
public function __construct(array $domainConfig)
|
||||
public function __construct(DataTransformerInterface $transformer)
|
||||
{
|
||||
$this->transformer = new ShortUrlDataTransformer($domainConfig);
|
||||
$this->transformer = $transformer;
|
||||
}
|
||||
|
||||
public function newVisitUpdate(Visit $visit): Update
|
||||
|
||||
Reference in New Issue
Block a user