From c4aa2a1356e5476911e15fee5ac6d9cb190051af Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 6 May 2024 13:59:50 +0400 Subject: [PATCH] Fix psalm issues --- src/Client/TrapHandle/Dumper.php | 8 +++++--- src/Client/TrapHandle/StaticState.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Client/TrapHandle/Dumper.php b/src/Client/TrapHandle/Dumper.php index 1e462048..9c7df70c 100644 --- a/src/Client/TrapHandle/Dumper.php +++ b/src/Client/TrapHandle/Dumper.php @@ -61,10 +61,12 @@ public static function setDumper(?DataDumperInterface $dumper = null): Closure use ($cloner, $dumper): ?string { $var = $cloner->cloneVar($var); - $context = StaticState::getValue()->dataContext; + /** @var array $context*/ + $context = StaticState::getValue()?->dataContext ?? []; - $label === null or $context['label'] ??= $label; - $label === [] or $var = $var->withContext($context); + /** @var string|null $label */ + $label === null or $context['label'] = $label; + $context === [] or $var = $var->withContext($context); $depth > 0 and $var = $var->withMaxDepth($depth); return $dumper->dump($var); diff --git a/src/Client/TrapHandle/StaticState.php b/src/Client/TrapHandle/StaticState.php index 461e02b1..1a0e45fe 100644 --- a/src/Client/TrapHandle/StaticState.php +++ b/src/Client/TrapHandle/StaticState.php @@ -12,6 +12,7 @@ */ final class StaticState { + /** @var array */ public array $dataContext = []; /**