mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Fix phpstan checks
This commit is contained in:
@@ -18,7 +18,7 @@ final readonly class PublishingUpdatesGenerator implements PublishingUpdatesGene
|
|||||||
public function newVisitUpdate(Visit $visit): Update
|
public function newVisitUpdate(Visit $visit): Update
|
||||||
{
|
{
|
||||||
return Update::forTopicAndPayload(Topic::NEW_VISIT->value, [
|
return Update::forTopicAndPayload(Topic::NEW_VISIT->value, [
|
||||||
'shortUrl' => $this->shortUrlTransformer->transform($visit->shortUrl),
|
'shortUrl' => $this->transformShortUrl($visit->shortUrl),
|
||||||
'visit' => $visit->jsonSerialize(),
|
'visit' => $visit->jsonSerialize(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ final readonly class PublishingUpdatesGenerator implements PublishingUpdatesGene
|
|||||||
$topic = Topic::newShortUrlVisit($shortUrl?->getShortCode());
|
$topic = Topic::newShortUrlVisit($shortUrl?->getShortCode());
|
||||||
|
|
||||||
return Update::forTopicAndPayload($topic, [
|
return Update::forTopicAndPayload($topic, [
|
||||||
'shortUrl' => $this->shortUrlTransformer->transform($shortUrl),
|
'shortUrl' => $this->transformShortUrl($shortUrl),
|
||||||
'visit' => $visit->jsonSerialize(),
|
'visit' => $visit->jsonSerialize(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -47,4 +47,9 @@ final readonly class PublishingUpdatesGenerator implements PublishingUpdatesGene
|
|||||||
'shortUrl' => $this->shortUrlTransformer->transform($shortUrl),
|
'shortUrl' => $this->shortUrlTransformer->transform($shortUrl),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function transformShortUrl(?ShortUrl $shortUrl): array
|
||||||
|
{
|
||||||
|
return $shortUrl === null ? [] : $this->shortUrlTransformer->transform($shortUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user