*/ private array $extra; /** * @param array $extra */ public function __construct( string $requestId, string $ip, string $uri, string $method, string $contentType, int $contentLength, string $user, string $userAgent, string $transferEncoding, array $extra = [] ) { $this->requestId = $requestId; $this->ip = $ip; $this->uri = $uri; $this->method = $method; $this->contentType = $contentType; $this->contentLength = $contentLength; $this->user = $user; $this->userAgent = $userAgent; $this->transferEncoding = $transferEncoding; $this->extra = $extra; } public function getRequestId(): string { return $this->requestId; } public function getIp(): string { return $this->ip; } public function getUri(): string { return $this->uri; } public function getMethod(): string { return $this->method; } public function getContentType(): string { return $this->contentType; } public function getContentLength(): int { return $this->contentLength; } public function getUser(): string { return $this->user; } public function getUserAgent(): string { return $this->userAgent; } public function getTransferEncoding(): string { return $this->transferEncoding; } /** * @return array */ public function getExtra(): array { return $this->extra; } /** * @return array */ public function toArray(): array { return [ 'request_id' => $this->requestId, 'ip' => $this->ip, 'uri' => $this->uri, 'method' => $this->method, 'ctype' => $this->contentType, 'clen' => $this->contentLength, 'user' => $this->user, 'ua' => $this->userAgent, 'transfer_encoding' => $this->transferEncoding, 'extra' => $this->extra, ]; } }