Serializes a protocol buffer that might not have all of the required fields
set.

@return string The serialized protocol buffer.
10799
public function serializePartialToString() {
    $enc = new Encoder();
    $this->outputPartial($enc);
    $res = $enc->toString();

    # Continue to be a little paranoid about the correctness of the protocol
    # buffer implementation.
    if (mt_rand(0, 99) === 0 && $this->byteSizePartial() !== strlen($res)) {
      throw new ProtocolBufferEncodeError(
        "Internal bug: Encoded size doesn't match predicted");
    }
    return $res;
  }
162073
public function serialize()
	{
		return serialize(array(	$this->pemFile,
								$this->passphrase,
								$this->endpointEnv,

								$this->isValidated,
								$this->description,
								$this->validFrom,
								$this->validTo));
	}
181052
public function serialize()
    {
        return serialize([$this->container, $this->userList, $this->database, $this->connection]);
    }
1029617
public function serialize()
    {
        return serialize([
            $this->id,
            $this->password,
            $this->email,
            $this->isActive,
            $this->lastLogin,
            $this->createdAt,
        ]);
    }
688361
public function serialize() {
        $r=['user'=>$this->user
            ,'name'=>$this->fullName
            ,'uid'=>$this->uid
            ,'group'=>$this->group
            ,'role'=>$this->role];
        /* optional fields */
        if ($this->email!==null) $r['email']=$this->email;
        if ($this->iduser!==null) $r['iduser']=$this->iduser;

        $r['extrafields']=$this->extraFields;

        return $r;
    }
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)) ?: '');
    }
571498
public static function protocolSchema()
    {
        $schema = '';
        if( preg_match( "#^([a-zA-Z]+)/.*$#", self::serverVariable( 'SERVER_PROTOCOL' ), $schemaMatches ) )
        {
            $schema = strtolower( $schemaMatches[1] ) . '://';
        }

        return $schema;
    }
399771
public function serialize() {
		$assoc = $this->isAssociative === null ? 'n' : ( $this->isAssociative ? 't' : 'f' );

		$data = [
			'data' => $this->getArrayCopy(),
			'index' => $this->indexOffset,
			'typePointers' => $this->typePointers,
			'assoc' => $assoc
		];

		return serialize( $data );
	}
637238
public function toString() {
        $str = $this->protocol . '://' . $this->hostName;
        if ($this->protocol==='http' && $this->portNumber==80) {
            //don't add port
        } else if ($this->protocol==='https' && $this->portNumber==443) {
            //don't add port
        } else {
            $str .= ':'. $this->portNumber;
        }
        return $str;
    }
1135865
public function serialize(): array {
        // base 64 encode
        $details = array_map(function($value) {
            return base64_encode($value);
        }, $this->details);

        // enrich with encryption type
        return $details + ['encryption' => $this->encryption];
    }
1041142
public function serialize()
    {
        if ($this->response) {
            return serialize((string) $this->response->getBody());
        }

        return serialize(null);
    }
25506
function serialize()
	{
		$propvals = array();
		$ro = new ReflectionObject($this);

		foreach ($ro->getProperties() as $rp )
		{
			$propname = $rp->getName();

			if (!in_array($propname,self::$NoCacheProperties))
			{
				if (method_exists($rp,"setAccessible"))
				{
					$rp->setAccessible(true);
					$propvals[$propname] = $rp->getValue($this);
				}
				elseif (!$rp->isPrivate())
				{
					// if < php 5.3 we can't serialize private vars
					$propvals[$propname] = $rp->getValue($this);
				}

			}
		}

		return serialize($propvals);
	}
1068583
public function serialize()
    {
        $data = array();

        $private_properties = array(
            'row_wrapper_class',
            'index_field',
            'objects',
            'objects_by_index',
            'options'
        );

        foreach ($private_properties as $property) {
            $data[$property] = $this->$property;
        }

        return serialize($data);
    }
1328565
protected function serialize()
	{
		// Remove the first token, which should be T_OPEN_TAG, aka "<?php"
		unset($this->tokens[0]);

		$php = '';
		foreach ($this->tokens as $token)
		{
			$php .= (is_string($token)) ? $token : $token[1];
		}

		return $php;
	}
1014580
public function serialize()
    {
        return base64_encode(json_encode([
            'sessionName' => $this->session->name(),
            'transactionId' => $this->transactionId,
            'readTimestamp' => $this->readTimestamp->formatAsString()
        ]));
    }
606239
public function serialize()
    {
        $data = serialize(
            [
                $this->ffmpegBinary,
                $this->movieFile,
                $this->output,
                $this->frameNumber,
                $this->provider,
            ]
        );

        return $data;
    }
1218124
public function serialize()
    {
        return serialize([
            'sp_map'    => $this->spMap,
            'sc_map'    => $this->scMap,
            'm_map'     => $this->mMap,
            'routes'    => $this->routes,
            'timestamp' => $this->timestamp
        ]);
    }