Final Class Yiisoft\VarDumper\Handler\CompositeHandler
| Inheritance | Yiisoft\VarDumper\Handler\CompositeHandler |
|---|---|
| Implements | Yiisoft\VarDumper\HandlerInterface |
CompositeHandler allows to use multiple handlers at once.
It iterates over all handlers and calls their {@see \Yiisoft\VarDumper\HandlerInterface::handle()} method. For example, you may use it to output data to both {@see \Yiisoft\VarDumper\Handler\StreamHandler} and {@see \Yiisoft\VarDumper\Handler\EchoHandler} at once.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\VarDumper\Handler\CompositeHandler | |
| handle() | Yiisoft\VarDumper\Handler\CompositeHandler |
Method Details
| public mixed __construct ( Yiisoft\VarDumper\HandlerInterface[] $handlers ) | ||
| $handlers | Yiisoft\VarDumper\HandlerInterface[] | |
public function __construct(
private array $handlers
) {
}
| public void handle ( mixed $variable, integer $depth, boolean $highlight = false ) | ||
| $variable | mixed | |
| $depth | integer | |
| $highlight | boolean | |
public function handle(mixed $variable, int $depth, bool $highlight = false): void
{
foreach ($this->handlers as $handler) {
$handler->handle($variable, $depth, $highlight);
}
}
Signup or Login in order to comment.