Skip to content

Commit

Permalink
chore(psalm): fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Jun 1, 2024
1 parent 0403cb3 commit fd1889c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ function td(mixed ...$values): never
* Register the var-dump caster for protobuf messages
*/
if (\class_exists(AbstractCloner::class)) {
/** @var array<class-string, callable> $casters */
/** @psalm-suppress UnsupportedPropertyReferenceUsage */
$casters = &AbstractCloner::$defaultCasters;

/**
* Define var-dump related casters for protobuf messages and traces.
*
* @var array<non-empty-string, callable> $casters
*/
$casters[Message::class] ??= [ProtobufCaster::class, 'cast'];
$casters[RepeatedField::class] ??= [ProtobufCaster::class, 'castRepeated'];
$casters[MapField::class] ??= [ProtobufCaster::class, 'castMap'];
Expand Down

0 comments on commit fd1889c

Please sign in to comment.