| 1 | <?php |
||
| 8 | final class Visitor |
||
| 9 | { |
||
| 10 | public const REMOTE_ADDRESS_ATTR = 'remote_address'; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $userAgent; |
||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $referer; |
||
| 20 | /** |
||
| 21 | * @var string|null |
||
| 22 | */ |
||
| 23 | private $remoteAddress; |
||
| 24 | |||
| 25 | 4 | public function __construct(string $userAgent, string $referer, ?string $remoteAddress) |
|
| 31 | |||
| 32 | 2 | public static function fromRequest(ServerRequestInterface $request): self |
|
| 40 | |||
| 41 | 1 | public static function emptyInstance(): self |
|
| 45 | |||
| 46 | 2 | public function getUserAgent(): string |
|
| 50 | |||
| 51 | 2 | public function getReferer(): string |
|
| 55 | |||
| 56 | 2 | public function getRemoteAddress(): ?string |
|
| 60 | } |
||
| 61 |