We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57c39b9 commit 79abd68Copy full SHA for 79abd68
src/Builder/Encoder/RecursiveEncode.php
@@ -11,6 +11,7 @@
11
use function get_object_vars;
12
use function is_array;
13
14
+/** @internal */
15
trait RecursiveEncode
16
{
17
/** @param WeakReference<Encoder> $encoder */
@@ -46,6 +47,12 @@ private function recursiveEncode(mixed $value): mixed
46
47
return $value;
48
}
49
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
+ */
56
return $this->encoder->get()->encodeIfSupported($value);
57
58
0 commit comments