Skip to content

Commit 79abd68

Browse files
committed
Suppress psalm error
1 parent 57c39b9 commit 79abd68

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Builder/Encoder/RecursiveEncode.php

Lines changed: 7 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,12 @@ 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+
* @psalm-suppress PossiblyNullReference
55+
*/
4956
return $this->encoder->get()->encodeIfSupported($value);
5057
}
5158
}

0 commit comments

Comments
 (0)