From 6e9fdbb836a94e0c0c671c427ccf6cabc7ecd941 Mon Sep 17 00:00:00 2001 From: Lito Date: Fri, 29 Nov 2024 12:29:25 +0100 Subject: [PATCH] Fix PHP 8.4 deprecation warning --- src/Recorders/DumpRecorder/MultiDumpHandler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Recorders/DumpRecorder/MultiDumpHandler.php b/src/Recorders/DumpRecorder/MultiDumpHandler.php index 9bf72f07..4ddea17a 100644 --- a/src/Recorders/DumpRecorder/MultiDumpHandler.php +++ b/src/Recorders/DumpRecorder/MultiDumpHandler.php @@ -16,9 +16,11 @@ public function dump(mixed $value): void } } - public function addHandler(callable $callable = null): self + public function addHandler(?callable $callable = null): self { - $this->handlers[] = $callable; + if ($callable) { + $this->handlers[] = $callable; + } return $this; }