0 follower

Final Class Yiisoft\VarDumper\Handler\CompositeHandler

InheritanceYiisoft\VarDumper\Handler\CompositeHandler
ImplementsYiisoft\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.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\VarDumper\HandlerInterface[] $handlers )
$handlers Yiisoft\VarDumper\HandlerInterface[]

                public function __construct(
    private array $handlers
) {
}

            
handle() public method

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);
    }
}