mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-08 08:13:11 +08:00
Updated to readonly public props on as many models as possible
This commit is contained in:
@@ -8,15 +8,10 @@ use JsonSerializable;
|
||||
|
||||
abstract class AbstractVisitEvent implements JsonSerializable
|
||||
{
|
||||
public function __construct(protected string $visitId)
|
||||
public function __construct(public readonly string $visitId)
|
||||
{
|
||||
}
|
||||
|
||||
public function visitId(): string
|
||||
{
|
||||
return $this->visitId;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return ['visitId' => $this->visitId];
|
||||
|
||||
@@ -6,13 +6,8 @@ namespace Shlinkio\Shlink\Core\EventDispatcher\Event;
|
||||
|
||||
final class UrlVisited extends AbstractVisitEvent
|
||||
{
|
||||
public function __construct(string $visitId, private ?string $originalIpAddress = null)
|
||||
public function __construct(string $visitId, public readonly ?string $originalIpAddress = null)
|
||||
{
|
||||
parent::__construct($visitId);
|
||||
}
|
||||
|
||||
public function originalIpAddress(): ?string
|
||||
{
|
||||
return $this->originalIpAddress;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user