Class Yiisoft\Yii\Debug\Collector\ServiceProxy
| Inheritance | Yiisoft\Yii\Debug\Collector\ServiceProxy » Yiisoft\Proxy\ObjectProxy |
|---|---|
| Uses Traits | Yiisoft\Yii\Debug\Collector\ProxyLogTrait |
| Subclasses | Yiisoft\Yii\Debug\Collector\ServiceMethodProxy |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Yii\Debug\Collector\ServiceProxy |
Protected Methods
Method Details
| public __construct( string $service, object $instance, Yiisoft\Yii\Debug\Collector\ContainerProxyConfig $config ): mixed | ||
| $service | string | |
| $instance | object | |
| $config | Yiisoft\Yii\Debug\Collector\ContainerProxyConfig | |
public function __construct(
private readonly string $service,
object $instance,
ContainerProxyConfig $config,
) {
$this->config = $config;
parent::__construct($instance);
}
| protected afterCall( string $methodName, array $arguments, mixed $result, float $timeStart ): mixed | ||
| $methodName | string | |
| $arguments | array | |
| $result | mixed | |
| $timeStart | float | |
protected function afterCall(string $methodName, array $arguments, mixed $result, float $timeStart): mixed
{
$this->logProxy($this->service, $this->getInstance(), $methodName, $arguments, $result, $timeStart);
return $result;
}
| protected getConfig( ): Yiisoft\Yii\Debug\Collector\ContainerProxyConfig |
protected function getConfig(): ContainerProxyConfig
{
return $this->config;
}
| protected getNewStaticInstance( object $instance ): \Yiisoft\Proxy\ObjectProxy | ||
| $instance | object | |
protected function getNewStaticInstance(object $instance): ObjectProxy
{
/**
* @psalm-suppress UnsafeInstantiation Constructor should be consistent to `getNewStaticInstance()`.
*/
return new static($this->service, $instance, $this->config);
}
| protected logProxy( string $service, object $instance, string $method, array $arguments, mixed $result, float $timeStart ): void | ||
| $service | string | |
| $instance | object | |
| $method | string | |
| $arguments | array | |
| $result | mixed | |
| $timeStart | float | |
protected function logProxy(
string $service,
object $instance,
string $method,
array $arguments,
mixed $result,
float $timeStart
): void {
$error = $this->getCurrentError();
$this->processLogData($arguments, $result, $error);
if ($this->config->getCollector() !== null) {
$this->logToCollector($service, $instance, $method, $arguments, $result, $error, $timeStart);
}
if ($this->config->getDispatcher() !== null) {
$this->logToEvent($service, $instance, $method, $arguments, $result, $error, $timeStart);
}
}
Signup or Login in order to comment.