class ClientRequestWatcher extends Watcher

Methods

__construct(array $options = [])

Create a new watcher instance.

from  Watcher
void
register(Application $app)

Register the watcher.

setOptions(array $options)

Set the watcher options.

from  Watcher
mixed
recordRequest(ProceedingJoinPoint $proceedingJoinPoint)

Record a Guzzle request intercepted via AOP.

array
buildRequestData(RequestInterface $request, TransferStats $stats, array $options)

Build the request data array for a completed transfer.

array|string
buildPayload(RequestInterface $request, array $options)

Build the request payload, using structured Hypervel data when available.

array|string
structuredPayload(RequestInterface $request, array $data)

Format the structured payload from Hypervel's HTTP client.

array
formatMultipartData(array $data)

Format multipart data for display.

array|string
payload(array $payload)

Format the structured payload with size limit and parameter hiding.

array|string
getRequestPayload(RequestInterface $request)

Extract the payload from the raw PSR-7 request body.

array
getResponse(ResponseInterface $response)

Extract response data from the PSR-7 response.

array|string
getResponsePayload(ResponseInterface $response)

Extract the payload from the PSR-7 response body.

array
headers(array $headers)

Format the given headers.

array
hideParameters(array $data, array $hidden)

Hide the given parameters.

Details

in Watcher at line 16
__construct(array $options = [])

Create a new watcher instance.

Parameters

array $options

the configured watcher options

at line 31
void register(Application $app)

Register the watcher.

Interception is handled by GuzzleHttpClientAspect via AOP.

Parameters

Application $app

Return Value

void

in Watcher at line 29
Watcher setOptions(array $options)

Set the watcher options.

Parameters

array $options

Return Value

Watcher

at line 38
mixed recordRequest(ProceedingJoinPoint $proceedingJoinPoint)

Record a Guzzle request intercepted via AOP.

Parameters

ProceedingJoinPoint $proceedingJoinPoint

Return Value

mixed

at line 132
protected array buildRequestData(RequestInterface $request, TransferStats $stats, array $options)

Build the request data array for a completed transfer.

Parameters

RequestInterface $request
TransferStats $stats
array $options

Return Value

array

at line 150
protected array|string buildPayload(RequestInterface $request, array $options)

Build the request payload, using structured Hypervel data when available.

When the request originated from Hypervel's HTTP client, the structured payload data is available in the hypervel_data Guzzle option. For direct Guzzle or third-party traffic, fall back to raw PSR-7 body parsing.

Parameters

RequestInterface $request
array $options

Return Value

array|string

at line 162
protected array|string structuredPayload(RequestInterface $request, array $data)

Format the structured payload from Hypervel's HTTP client.

Parameters

RequestInterface $request
array $data

Return Value

array|string

at line 179
protected array formatMultipartData(array $data)

Format multipart data for display.

Parameters

array $data

Return Value

array

at line 213
protected array|string payload(array $payload)

Format the structured payload with size limit and parameter hiding.

Parameters

array $payload

Return Value

array|string

at line 235
protected array|string getRequestPayload(RequestInterface $request)

Extract the payload from the raw PSR-7 request body.

Parameters

RequestInterface $request

Return Value

array|string

at line 287
protected array getResponse(ResponseInterface $response)

Extract response data from the PSR-7 response.

Parameters

ResponseInterface $response

Return Value

array

at line 299
protected array|string getResponsePayload(ResponseInterface $response)

Extract the payload from the PSR-7 response body.

Parameters

ResponseInterface $response

Return Value

array|string

at line 361
protected array headers(array $headers)

Format the given headers.

Parameters

array $headers

Return Value

array

at line 384
protected array hideParameters(array $data, array $hidden)

Hide the given parameters.

Parameters

array $data
array $hidden

Return Value

array