Final Class Yiisoft\Yii\Debug\Collector\HttpClientInterfaceProxy
| Inheritance | Yiisoft\Yii\Debug\Collector\HttpClientInterfaceProxy |
|---|---|
| Implements | Psr\Http\Client\ClientInterface |
| Uses Traits | Yiisoft\Yii\Debug\ProxyDecoratedCalls |
Public Methods
Method Details
Defined in: Yiisoft\Yii\Debug\ProxyDecoratedCalls::__call()
| public __call( string $name, array $arguments ): mixed | ||
| $name | string | |
| $arguments | array | |
public function __call(string $name, array $arguments)
{
/**
* @psalm-suppress MixedMethodCall
*/
return $this->decorated->$name(...$arguments);
}
| public __construct( \Psr\Http\Client\ClientInterface $decorated, Yiisoft\Yii\Debug\Collector\HttpClientCollector $collector ): mixed | ||
| $decorated | \Psr\Http\Client\ClientInterface | |
| $collector | Yiisoft\Yii\Debug\Collector\HttpClientCollector | |
public function __construct(
private readonly ClientInterface $decorated,
private readonly HttpClientCollector $collector
) {
}
Defined in: Yiisoft\Yii\Debug\ProxyDecoratedCalls::__get()
| public __get( string $name ): mixed | ||
| $name | string | |
public function __get(string $name)
{
return $this->decorated->$name;
}
Defined in: Yiisoft\Yii\Debug\ProxyDecoratedCalls::__set()
| public __set( string $name, mixed $value ): void | ||
| $name | string | |
| $value | mixed | |
public function __set(string $name, mixed $value): void
{
$this->decorated->$name = $value;
}
| public sendRequest( \Psr\Http\Message\RequestInterface $request ): \Psr\Http\Message\ResponseInterface | ||
| $request | \Psr\Http\Message\RequestInterface | |
public function sendRequest(RequestInterface $request): ResponseInterface
{
/** @psalm-var array{file: string, line: int} $callStack */
$callStack = debug_backtrace()[0];
$uniqueId = random_bytes(36);
$startTime = microtime(true);
$this->collector->collect($request, $startTime, $callStack['file'] . ':' . $callStack['line'], $uniqueId);
$response = null;
try {
$response = $this->decorated->sendRequest($request);
} finally {
$endTime = microtime(true);
$this->collector->collectTotalTime($response, $endTime, $uniqueId);
}
return $response;
}
Signup or Login in order to comment.