File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,6 +165,10 @@ public static function jsonUnserialize(\stdClass $decoded): self
165165 $ n = new self ();
166166 foreach ((array )$ decoded as $ k => $ v ) {
167167 if ('Value ' === $ k ) {
168+ if (null === $ v ) {
169+ $ n ->Value = '' ;
170+ continue ;
171+ }
168172 $ val = base64_decode ($ v , true );
169173 if (false === $ val ) {
170174 throw new \DomainException (sprintf ('Could not base64 decode value "%s" ' , $ v ));
Original file line number Diff line number Diff line change @@ -154,6 +154,10 @@ public static function jsonUnserialize(\stdClass $decoded): self
154154 if ('Verb ' === $ k ) {
155155 $ n ->Verb = KVOp::from ($ v );
156156 } elseif ('Value ' === $ k ) {
157+ if (null === $ v ) {
158+ $ n ->Value = '' ;
159+ continue ;
160+ }
157161 $ val = base64_decode ($ v , true );
158162 if (false === $ val ) {
159163 throw new \DomainException (sprintf ('Could not base64 decode value "%s" ' , $ v ));
@@ -171,7 +175,7 @@ public function jsonSerialize(): \stdClass
171175 $ out = $ this ->_startJsonSerialize ();
172176 $ out ->Verb = $ this ->Verb ;
173177 $ out ->Key = $ this ->Key ;
174- $ out ->Value = $ this ->Value ;
178+ $ out ->Value = base64_encode ( $ this ->Value ) ;
175179 $ out ->Flags = $ this ->Flags ;
176180 $ out ->Index = $ this ->Index ;
177181 $ out ->Session = $ this ->Session ;
You can’t perform that action at this time.
0 commit comments