Skip to content

Commit

Permalink
Fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed May 6, 2024
1 parent 28739d7 commit c4aa2a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Client/TrapHandle/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<array-key, mixed> $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);
Expand Down
1 change: 1 addition & 0 deletions src/Client/TrapHandle/StaticState.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
final class StaticState
{
/** @var array<array-key, mixed> */
public array $dataContext = [];

/**
Expand Down

0 comments on commit c4aa2a1

Please sign in to comment.