Skip to content

Commit 7e3ab9c

Browse files
committed
Suppress psalm error
1 parent 57c39b9 commit 7e3ab9c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Builder/Encoder/RecursiveEncode.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use function get_object_vars;
1212
use function is_array;
1313

14+
/** @internal */
1415
trait RecursiveEncode
1516
{
1617
/** @param WeakReference<Encoder> $encoder */
@@ -46,6 +47,13 @@ private function recursiveEncode(mixed $value): mixed
4647
return $value;
4748
}
4849

50+
/**
51+
* If the BuilderEncoder instance is removed from the memory, the
52+
* instances of the classes using this trait will be removed as well.
53+
* Therefore, the weak reference will never return null.
54+
*
55+
* @psalm-suppress PossiblyNullReference
56+
*/
4957
return $this->encoder->get()->encodeIfSupported($value);
5058
}
5159
}

0 commit comments

Comments
 (0)