final class ClientContext (View source)

The requesting client as resolved once per request: the address behind any trusted proxy and the sanitized user agent. Built by the composition root and handed to everything that logs, throttles or audits by client.

Methods

__construct(string $ip, string $userAgent, string $browser, bool $isBot)

No description

static ClientContext
fromServer(array $server, ConfigurationInterface $config)

No description

Details

__construct(string $ip, string $userAgent, string $browser, bool $isBot)

No description

Parameters

string $ip

Resolved client address, empty when none could be validated

string $userAgent

Sanitized User-Agent header, "unknown" when absent

string $browser

Browser name and version derived from the user agent

bool $isBot

static ClientContext fromServer(array $server, ConfigurationInterface $config)

No description

Parameters

array $server

The request's $_SERVER array

ConfigurationInterface $config

Source of the trusted proxy list

Return Value

ClientContext