write($protocol); return $transport->getBuffer(); } public static function deserialize( string $str, T $object, ): T { $transport = new TMemoryBuffer($str); $protocol = new TSimpleJSONProtocol($transport); $object->read($protocol); return $object; } }