Added package to delegate the execution of event listeners to a swoole task worker

This commit is contained in:
Alejandro Celaya
2019-07-14 10:46:31 +02:00
parent 4380b62715
commit 0dfadcbb4a
6 changed files with 23 additions and 9 deletions

View File

@@ -3,7 +3,9 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\EventDispatcher;
final class ShortUrlVisited
use JsonSerializable;
final class ShortUrlVisited implements JsonSerializable
{
/** @var string */
private $visitId;
@@ -17,4 +19,9 @@ final class ShortUrlVisited
{
return $this->visitId;
}
public function jsonSerialize(): array
{
return ['visitId' => $this->visitId];
}
}

View File

@@ -25,14 +25,7 @@ final class UnknownVisitLocation implements VisitLocationInterface
return 'Unknown';
}
/**
* Specify data which should be serialized to JSON
* @link https://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
*/
public function jsonSerialize()
public function jsonSerialize(): array
{
return [
'countryCode' => 'Unknown',