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 Yiisoft\VarDumper\HandlerInterface::handle() method. For example, you may use it to output data to both Yiisoft\VarDumper\Handler\StreamHandler and 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 __construct( Yiisoft\VarDumper\HandlerInterface[] $handlers ): mixed | ||
| $handlers | Yiisoft\VarDumper\HandlerInterface[] | |
public function __construct(
private array $handlers
) {
}
| public handle( mixed $variable, integer $depth, boolean $highlight = false ): void | ||
| $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.