Returns data which should be serialized to JSON.

@return stdClass
434277
public function jsonSerialize()
    {
        $ret = new stdClass();
        $ret->code = $this->errorCode;
        $ret->message = $this->getUserMessage();

        return $ret;
    }
996608
function jsonSerialize(): \stdClass {
    return (object) [
      'lineNumber' => $this->getLineNumber(),
      'blockNumber' => $this->getBlockNumber(),
      'branchNumber' => $this->getBranchNumber(),
      'taken' => $this->getTaken()
    ];
  }
44669
public function getSerialized()
    {
        if (\is_numeric($this->modelId)) {
            return \sprintf('%s::%s', $this->dataProviderName, $this->modelId);
        }

        return \sprintf('%s::%s', $this->dataProviderName, \base64_encode(\json_encode($this->modelId)));
    }
497780
public function jsonSerialize()
    {
        $arr = parent::jsonSerialize();
        $vars = get_object_vars($this);
        return array_merge($vars, $arr);
    }
1095382
public function Build()
    {
        $obj           = new \stdClass();
        $obj->metadata = $this->metadata;
        $obj->contents = $this->contents;

        return \json_encode($obj);
    }
80775
public function jsonSerialize()
    {
        $data = $this->getData();
        if (empty($data)) {
            return null;
        }
        foreach (array_keys(static::FOREIGN_KEYS) as $column) {
            $data[$column] = $this->__get($column);
        }
        return $data;
    }
98845
public function jsonSerialize() {
        $ret = new \stdClass();

        $ret->maxRecipients = $this->maxRecipients;
        $ret->priority = $this->priority;

        if (is_null($this->deliveryStartDateTime) === false) {
            $ret->deliveryStartDateTime = $this->deliveryStartDateTime->format("Y-m-d\TH:i:s");
        }

        if (is_null($this->compileStartDateTime) === false) {
            $ret->compileStartDateTime = $this->compileStartDateTime->format("Y-m-d\TH:i:s");
        }

        $ret->compileBeforeDeliveryStart = $this->compileBeforeDeliveryStart;
        $ret->allowMultipleDeliveries = $this->allowMultipleDeliveries;
        $ret->deliverImmediately = $this->deliverImmediately;
        $ret->deliveryFrequency = $this->deliveryFrequency;
        $ret->obeyDeliveryLimits = $this->obeyDeliveryLimits;

        return $ret;
    }
523019
public function jsonSerialize()
    {
        $result = new \stdClass();
        $schema = static::schema();
        foreach ($schema->getProperties()->getDataKeyMap() as $propertyName => $dataName) {
            $value = $this->$propertyName;
            if ((null !== $value) || array_key_exists($propertyName, $this->__arrayOfData)) {
                $result->$dataName = $value;
            }
        }
        foreach ($schema->getNestedPropertyNames() as $name) {
            /** @var ObjectItem $nested */
            $nested = $this->$name;
            if (null !== $nested) {
                foreach ((array)$nested->jsonSerialize() as $key => $value) {
                    $result->$key = $value;
                }
            }
        }

        return $result;
    }
956900
public function jsonSerialize() {
        $ret = new \stdClass();
        $ret->name = $this->name;

        if(count($this->values) > 0) {
            $values = array();
            $values['values'] = $this->values;
            $ret->values = $values;
        }

        $ret->nullable = $this->nullable;

        return $ret;
    }
846695
public function jsonSerialize()
    {
        $data = new stdClass();
        // Strip undefined values.
        foreach (get_object_vars($this) as $property => $value) {
            if ($value !== UNDEFINED) {
                $data->$property = $value;
            }
        }
        // Strip properties that are for internal (swagger-php) use.
        foreach (static::$_blacklist as $property) {
            unset($data->$property);
        }
        // Correct empty array to empty objects.
        foreach (static::$_types as $property => $type) {
            if ($type === 'object' && is_array($data->$property) && empty($data->$property)) {
                $data->$property = new stdClass;
            }
        }
        // Inject vendor properties.
        unset($data->x);
        if (is_array($this->x)) {
            foreach ($this->x as $property => $value) {
                $prefixed = 'x-' . $property;
                $data->$prefixed = $value;
            }
        }
        // Map nested keys
        foreach (static::$_nested as $nested) {
            if (is_string($nested) || count($nested) === 1) {
                continue;
            }
            $property = $nested[0];
            if ($this->$property === UNDEFINED) {
                continue;
            }
            $keyField = $nested[1];
            $object = new stdClass();
            foreach ($this->$property as $key => $item) {
                if (is_numeric($key) === false && is_array($item)) {
                    $object->$key = $item;
                } else {
                    $key = $item->$keyField;
                    if ($key !== UNDEFINED && empty($object->$key)) {
                        if (method_exists($item, 'jsonSerialize')) {
                            $object->$key = $item->jsonSerialize();
                        } else {
                            $object->$key = $item;
                        }
                        unset($object->$key->$keyField);
                    }
                }
            }
            $data->$property = $object;
        }
        // $ref
        if (isset($data->ref)) {
            $dollarRef = '$ref';
            $data->$dollarRef = $data->ref;
            unset($data->ref);
        }
        return $data;
    }
958362
function jsonSerialize(): \stdClass {
    $map = new \stdClass;

    if (mb_strlen($repoToken = $this->getRepoToken())) $map->repo_token = $repoToken;
    if (mb_strlen($serviceName = $this->getServiceName())) $map->service_name = $serviceName;
    if (mb_strlen($serviceNumber = $this->getServiceNumber())) $map->service_number = $serviceNumber;
    if (mb_strlen($serviceJobId = $this->getServiceJobId())) $map->service_job_id = $serviceJobId;
    if (mb_strlen($servicePullRequest = $this->getServicePullRequest())) $map->service_pull_request = $servicePullRequest;

    $map->source_files = array_map(function(SourceFile $item) {
      return $item->jsonSerialize();
    }, $this->getSourceFiles()->getArrayCopy());

    if ($this->isParallel()) $map->parallel = true;
    if ($git = $this->getGit()) $map->git = $git->jsonSerialize();
    if (mb_strlen($commitSha = $this->getCommitSha())) $map->commit_sha = $commitSha;
    if ($runAt = $this->getRunAt()) $map->run_at = $runAt->format('c');

    return $map;
  }
300749
protected function formatJSON()
    {
        $result = new \stdClass();

        if ($this->outputMode == self::MODE_ERROR) {
            $this->formatFailure($result);
        } else {
            $this->formatSuccess($result);
        }

        // include valid, plain non-namespace data
        foreach ($this->plain as $key => $value) {
            $result->$key = $value;
        }
        //TODO: better handling of links (self, related, pagination) http://jsonapi.org/format/#document-links

        if ($this->meta) {
            $result->meta = $this->meta;
        }

        return $result;
    }
757118
public function jsonSerialize() {
        $ret = new \stdClass();

        $ret->name = $this->name;
        $ret->type = $this->type;

        if (is_null($this->subtype) === false) {
            $ret->subtype = $this->subtype;
        }

        $ret->subscriberList = $this->subscriberList;

        return $ret;
    }
1207966
public function jsonSerialize()
    {
        return [
            'class' => get_class($this->getMessage()),
            'data' => $this->getMessage()->jsonSerialize(),
            'signature' => $this->getSignature(),
            'certificate' => $this->getCertificate()
        ];
    }
553871
public function getJson()
    {
        $response = [
            'status' => $this->status,
        ];

        switch ($this->status) {
            case self::STATUS_SUCCESS:
            case self::STATUS_FAIL:
                $response = array_merge(
                    $response,
                    [
                        'data' => $this->data,
                    ]
                );
                break;
            case self::STATUS_ERROR;
                $code     = $this->code ? ['code' => $this->code] : [];
                $data     = $this->data ? ['data' => $this->data] : [];
                $response = array_merge(
                    $response,
                    [
                        'message' => $this->message,
                    ],
                    $code,
                    $data
                );
                break;
            default:
                // because of the check in setStatus, this should never occur
                $response = [
                    'status'  => self::STATUS_ERROR,
                    'code'    => 500,
                    'message' => 'JSend response was built illegally',
                    'data'    => [
                        'original-data' => [
                            'status'  => $this->status,
                            'code'    => $this->code,
                            'message' => $this->message,
                            'data'    => $this->data,
                        ],
                    ],
                ];
                break;
        }

        return json_encode($response);
    }
541480
public function serialize()
    {
        $output = array();
        foreach( $this->data as $key => $value ) {
            if( !array_key_exists( $key, static::$defaults ) or static::$defaults[$key] !== $value ) {
                $output[$key] = $value;
            }
        }
        return json_encode(
            array(
                $this->name,
                $this->entity,
                $this->fullyQualifiedName,
                $output
            )
        );
    }
1194247
public function serializeToJsonString()
    {
        $output = new CodedOutputStream($this->jsonByteSize());
        $this->serializeToJsonStream($output);
        return $output->getData();
    }