mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Migrated all constructor props to property promotion when possible
This commit is contained in:
@@ -8,11 +8,8 @@ use JsonSerializable;
|
||||
|
||||
abstract class AbstractVisitEvent implements JsonSerializable
|
||||
{
|
||||
protected string $visitId;
|
||||
|
||||
public function __construct(string $visitId)
|
||||
public function __construct(protected string $visitId)
|
||||
{
|
||||
$this->visitId = $visitId;
|
||||
}
|
||||
|
||||
public function visitId(): string
|
||||
|
||||
@@ -6,12 +6,9 @@ namespace Shlinkio\Shlink\Core\EventDispatcher\Event;
|
||||
|
||||
final class UrlVisited extends AbstractVisitEvent
|
||||
{
|
||||
private ?string $originalIpAddress;
|
||||
|
||||
public function __construct(string $visitId, ?string $originalIpAddress = null)
|
||||
public function __construct(string $visitId, private ?string $originalIpAddress = null)
|
||||
{
|
||||
parent::__construct($visitId);
|
||||
$this->originalIpAddress = $originalIpAddress;
|
||||
}
|
||||
|
||||
public function originalIpAddress(): ?string
|
||||
|
||||
Reference in New Issue
Block a user