Serialize StorageCapacityConfig into xml

@return string
498241
public function serializeToXml()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
        $xml->addChild('StorageCapacity', strval($this->storageCapacity));
        return $xml->asXML();
    }
907597
final public function serialize(): string
    {
        $vars = array_filter(get_object_vars($this));
        $vars['adviceMethod'] = static::serializeAdvice($this->adviceMethod);

        return serialize($vars);
    }
792339
protected function serializeToStorage()
  {
    $this->debugLog('serializeToStorage()');
    $this->storage->updateLists($this->lists);
    $this->storage->setUpdaterState($this->next_request_timestamp, $this->error_count);
    
    $this->debugLog('current memory usage: '.memory_get_usage());
    $this->debugLog('peak memory usage   : '.memory_get_peak_usage());
  }
224129
public function serialize() {
		$attributes = array();

		if ( $this->visible ) {
			// If visible attributes are set, we'll only reveal those.
			foreach ( $this->visible as $key ) {
				$attributes[ $key ] = $this->get_attribute( $key );
			}
		} elseif ( $this->hidden ) {
			// If hidden attributes are set, we'll grab everything and hide those.
			foreach ( $this->get_attribute_keys() as $key ) {
				if ( ! in_array( $key, $this->hidden ) ) {
					$attributes[ $key ] = $this->get_attribute( $key );
				}
			}
		} else {
			// If nothing is hidden/visible, we'll grab and reveal everything.
			foreach ( $this->get_attribute_keys() as $key ) {
				$attributes[ $key ] = $this->get_attribute( $key );
			}
		}

		return array_map( function ( $attribute ) {
			if ( $attribute instanceof Serializes ) {
				return $attribute->serialize();
			}

			return $attribute;
		}, $attributes );
	}
698247
public function serialize()
    {
        $args = join(' ', $this->args);

        // nargs must be last and only 1

        $options = [];
        $narg = null;
        foreach ($this->options as $option => $value) {
            if (is_array($value)) {
                $narg = "$option ".join(' ', array_map('strval', $value));
                continue;
            }

            if (is_numeric($option)) {
                $options[] = strval($value);
            } elseif (is_bool($value)) {
                $options[] = $option;
            } else {
                $options[] = trim("$option $value");
            }
        }

        if (!is_null($narg)) {
            array_push($options, $narg);
        }

        return trim(preg_replace('/[\s]{2,}/', ' ', "{$this->binary} $args ".join(' ', $options)) ?: '');
    }
891103
public static function makeFromSerial()
    {
        $contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser');
        $r = unserialize($contents);
        if (!$r) {
            $hash = sha1($contents);
            trigger_error("Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR);
        }
        return $r;
    }
1124865
public function serialize()
    {
        $spec = array(
            '_aFeatures'      => $this->_aFeatures,
            '_aGroup'         => $this->_aGroup,
            '_browser'        => $this->_browser,
            '_browserVersion' => $this->_browserVersion,
            '_userAgent'      => $this->_userAgent,
            '_images'         => $this->_images,
        );
        return serialize($spec);
    }
615298
public function getXmlContent()
    {        
        if($this->getUseCache() && file_exists(get_storage_path('cache').$this->getCacheFileName())) { 
            $contents = file_get_contents(get_storage_path('cache').$this->getCacheFileName());
        } else {
            $contents = file_get_contents( $this->getUrl());
            file_put_contents(get_storage_path('cache').$this->getCacheFileName(), $contents);
        }        
        return simplexml_load_string( $contents);
    }
2782
public function serializeToString()
    {
        $output = new CodedOutputStream($this->byteSize());
        $this->serializeToStream($output);
        return $output->getData();
    }
1329347
public function serialize()
    {
        $debugOutputResource = null;
        if (is_resource($this->debugOutputResource)) {
            $metadata = stream_get_meta_data($this->debugOutputResource);
            $debugOutputResource = [
                'uri' => $metadata['uri'],
                'mode' => $metadata['mode']
            ];
        }

        return serialize([
            $this->messageKey,
            $this->batchEnabled,
            $this->metadataProvider,
            $this->debugOutput,
            $this->clientConfig,
            $this->batchMethod,
            $this->logName,
            $debugOutputResource
        ]);
    }
472035
public function encode()
    {
        $xmlData = $this->saveXML();
        $mediaSource = $this->getMediaSource();
        if ($mediaSource === null) {
            // No attachment, just send XML for entry
            return $xmlData;
        } else {
            return new Zend_Gdata_MediaMimeStream($xmlData,
                $mediaSource->getFilename(), $mediaSource->getContentType());
        }
    }
968938
public function serialize(): string
    {
        return serialize(
            $this->definitionMap
                ->mapWithKeys(function (DefinitionNode $node, string $key): array {
                    return [$key => AST::toArray($node)];
                })
        );
    }
258283
public function serialize()
	{
		return serialize(array(	$this->deviceToken,
								$this->certificate,
								$this->expiresAt,
								$this->alert,
								$this->badge,
								$this->sound,
								$this->payload,
								$this->contentAvailable));
	}
1365935
public function serialize()
    {
        $data = array(
            'application' => $this->_application,
            'type'		  => $this->_type,
            'package'	  => $this->_package,
            'path'		  => $this->_path,
            'name'		  => $this->_name,
            'identifier'  => $this->_identifier,
            'basepath'    => $this->_basepath,
            'filepath'	  => $this->filepath,
            'classname'   => $this->classname,
        );

        return serialize($data);
    }
92026
public function to_xml(){
        $str= "<update ";
		$str .= 'status="'.$this->data['action_table_type'].'" ';
		$str .= 'id="'.$this->data['dataId'].'" ';
		$str .= 'parent="'.$this->get_parent_id().'"';
		$str .= '>';
		$str .= $this->child->to_xml();
		$str .= '</update>';
        return $str;
	}
854040
public function xml()
    {
        foreach ($this->_result as $printer=>$markersupplies_item) {
            $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
            $xmlsnmppinfo_printer->addAttribute("Device", $printer);
            if (isset($markersupplies_item[1]) &&
                isset($markersupplies_item[1]['prtMarkerSuppliesDescriptionRicoh']) &&
                isset($markersupplies_item[1]['prtMarkerSuppliesLevelRicoh'])) {
                $ricoh = true;
            } else {
                $ricoh = false;
            }

            foreach ($markersupplies_item as $marker=>$snmppinfo_item) {
                if ($marker==0) {
                    $xmlsnmppinfo_printer->addAttribute("Name", $snmppinfo_item['prtMarkerSuppliesDescription']);
                } elseif ($marker==99) {
                    foreach ($snmppinfo_item as $item=>$iarr) {
                        if (isset($iarr["message"]) && $iarr["message"] != "") {
                            $xmlsnmppinfo_errors = $xmlsnmppinfo_printer->addChild("PrinterMessage");
                            $xmlsnmppinfo_errors->addAttribute("Message", $iarr["message"]);
                            $xmlsnmppinfo_errors->addAttribute("Severity", $iarr["severity"]);
                        }
                    }
                } else {
                    if ($ricoh) {
                        if (isset($snmppinfo_item['prtMarkerSuppliesDescriptionRicoh'])) {
                            $xmlsnmppinfo = $xmlsnmppinfo_printer->addChild("MarkerSupplies");

                            $xmlsnmppinfo->addAttribute("Description", $snmppinfo_item['prtMarkerSuppliesDescriptionRicoh']);
                            $xmlsnmppinfo->addAttribute("SupplyUnit", "19");
                            $xmlsnmppinfo->addAttribute("MaxCapacity", "100");
                            $xmlsnmppinfo->addAttribute("Level", isset($snmppinfo_item['prtMarkerSuppliesLevelRicoh']) ? $snmppinfo_item['prtMarkerSuppliesLevelRicoh'] : "");
                        }
                    } else {
                        $xmlsnmppinfo = $xmlsnmppinfo_printer->addChild("MarkerSupplies");

                        $xmlsnmppinfo->addAttribute("Description", isset($snmppinfo_item['prtMarkerSuppliesDescription']) ? $snmppinfo_item['prtMarkerSuppliesDescription'] : "");
                        $xmlsnmppinfo->addAttribute("SupplyUnit", isset($snmppinfo_item['prtMarkerSuppliesSupplyUnit']) ? $snmppinfo_item['prtMarkerSuppliesSupplyUnit'] : "");
                        $xmlsnmppinfo->addAttribute("MaxCapacity", isset($snmppinfo_item['prtMarkerSuppliesMaxCapacity']) ? $snmppinfo_item['prtMarkerSuppliesMaxCapacity'] : "");
                        $xmlsnmppinfo->addAttribute("Level", isset($snmppinfo_item['prtMarkerSuppliesLevel']) ? $snmppinfo_item['prtMarkerSuppliesLevel'] : "");
                    }
                }
            }
        }

        return $this->xml->getSimpleXmlElement();
    }
317733
public function serialize()
    {
        $serialized = serialize([$this->_options, $this->_auth]);

        // encode data (optionally attempt to zip)
        if (function_exists('gzencode') && isset($this->_options['serialzip']) && $this->_options['serialzip']) {
            $encoded = self::GZIP_SERIAL_PREFIX . gzencode($serialized);
        } else {
            $encoded = self::BASE64_SERIAL_PREFIX . base64_encode($serialized);
        }
        return $encoded;
    }