Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Spatie\LaravelIgnition\Recorders\DumpRecorder;
4
 
5
class MultiDumpHandler
6
{
7
    /** @var array<int, callable|null> */
8
    protected array $handlers = [];
9
 
10
    public function dump(mixed $value): void
11
    {
12
        foreach ($this->handlers as $handler) {
13
            if ($handler) {
14
                $handler($value);
15
            }
16
        }
17
    }
18
 
19
    public function addHandler(callable $callable = null): self
20
    {
21
        $this->handlers[] = $callable;
22
 
23
        return $this;
24
    }
25
}