Convert the object into something JSON serializable.

@return array
168838
public function jsonSerialize()
    {
        $attributes = $this->getAttributes();

        array_walk_recursive($attributes, function(&$val) {
            if (MbString::isLoaded()) {
                // If we're able to detect the attribute
                // encoding, we'll encode only the
                // attributes that need to be.
                if (! MbString::isUtf8($val)) {
                    $val = utf8_encode($val);
                }
            } else {
                // If the mbstring extension is not loaded, we'll
                // encode all attributes to make sure
                // they are encoded properly.
                $val = utf8_encode($val);
            }
        });

        // We'll replace the binary GUID and SID with
        // their string equivalents for convenience.
        return array_replace($attributes, [
            $this->schema->objectGuid() => $this->getConvertedGuid(),
            $this->schema->objectSid() => $this->getConvertedSid(),
        ]);
    }
861685
public function jsonSerialize(): array
    {
        return [
            'number' => $this->getWeekNumber(),
            'days' => array_map(function(Day $day) {
                return $day->jsonSerialize();
            }, $this->days)
        ];
    }
1185196
public function toJson() {
		$array = array("types"=>array());
		foreach ($this->types as $type) {
			$array["types"][] = $type->toJson();
		}
		if ($this->warningMessage) {
			$array["warning"] = $this->warningMessage;
		}
		return $array;
	}
470158
public function toArrayAll()
    {
        $data = $this->toArray();

        foreach(self::$jsonable as $key){

            if(isset($data[$key]) && Utils::isJson($data[$key])){
                $data[$key] = json_decode($this->{$key});
            }
        }

        return $data;
    }
1110607
public function jsonSerialize()
    {
        $data = [
            'title' => $this->title,
            'address' => $this->address
        ];


        $data = array_merge($data, $this->buildJsonAttributes([
            'reply_markup' => $this->replyMarkup
        ]));

        return $data;
    }
88815
public function jsonSerialize()
    {
        $parameters = [];

        foreach ($this->parameters as $parameter) {
            if ('VALUE' === $parameter->name) {
                continue;
            }
            $parameters[strtolower($parameter->name)] = $parameter->jsonSerialize();
        }
        // In jCard, we need to encode the property-group as a separate 'group'
        // parameter.
        if ($this->group) {
            $parameters['group'] = $this->group;
        }

        return array_merge(
            [
                strtolower($this->name),
                (object) $parameters,
                strtolower($this->getValueType()),
            ],
            $this->getJsonValue()
        );
    }
1267346
public function jsonSerialize()
    {
        return [
            'id' => $this->id,
            'size' => $this->size,
            'link' => $this->link,
            'title' => $this->title,
            'caption' => $this->caption,
            'description' => $this->description,
            'type' => $this->type,
            'mimeType' => $this->mime_type,
            'meta' => $this->meta,
            'width' => $this->width,
            'height' => $this->height,
        ];
    }
716365
public function toJSON()
    {
        $result = [
            'Status' => $this->Status(),
            'ShouldPass' => $this->ShouldPass(),
            'Checks' => []
        ];
        foreach ($this->details as $detail) {
            $result['Checks'][] = $detail->toMap();
        }
        return json_encode($result);
    }
822466
public function jsonSerialize()
    {
        // if formatting is requested, well then format baby!
        $config = $this->di->get('config');
        if ($config['application']['propertyFormatTo'] == 'none') {
            $attributes = $this->attributes;
        } else {
            $inflector = $this->di->get('inflector');
            $attributes = [];
            foreach ($this->attributes as $key => $value) {
                $attributes[$inflector->normalize($key,
                    $config['application']['propertyFormatTo'])] = $value;
            }
        }

        $result = [
            'id' => $this->id,
            'type' => $this->type,
            'attributes' => $attributes
        ];

        if ($this->relationships) {
            $result['relationships'] = $this->relationships;
        }

        return $result;
    }
1116093
public function toJSON()
    {
        $mapper = static::getMapper();
        $json = [];

        foreach ($this->toArray() as $key => $value) {
            $attribute = $mapper->getAttribute($key);
            $json[$key] = Type::factory($attribute['type'])->toJSON($value, $attribute);
        }

        return $json;
    }
889134
public function jsonSerialize() {
        $data = new stdClass();
        $vars = get_object_vars($this);

        foreach ($vars as $property => $value) {
            if ($value === null) {
                continue;
            }

            $data->{$property} = $value;
        }

        return $data;
    }
136682
public function toArray()
    {
        $json            = [];
        $json['jsonrpc'] = $this->jsonrpc;

        if ($this->method) {
            $json['method'] = $this->method;
        }

        $json['method'] = $this->method;

        if ($this->params) {
            $json['params'] = $this->params;
        }

        if ($this->id) {
            $json['id'] = $this->id;
        }

        return $json;
    }
54720
public function jsonSerialize()
    {
        return [
            'author' => $this->author,
            'comment_count' => $this->comment_count,
            'comment_status' => $this->comment_status,
            'content' => $this->content,
            'created_at' => $this->created_at,
            'excerpt' => $this->excerpt,
            'format' => $this->format,
            'id' => $this->id,
            'link' => $this->link,
            'menu_order' => $this->menu_order,
            'meta' => $this->rejectHiddenMeta($this->meta),
            'mime_type' => $this->mime_type,
            'modified_at' => $this->modified_at,
            'parent_id' => $this->parent_id,
            'password' => $this->password,
            'ping' => $this->ping,
            'ping_status' => $this->ping_status,
            'pinged' => $this->pinged,
            'slug' => $this->slug,
            'status' => $this->status,
            'template' => $this->template,
            'thumbnail' => $this->thumbnail,
            'title' => $this->title,
            'type' => $this->type,
        ];
    }
164177
public function jsonSerialize()
    {
        $parameters = [];

        if ($this->accessToken) {
            $parameters['access_token'] = $this->accessToken;
        }

        if ($this->userId) {
            $parameters['user_id'] = $this->userId;
        }

        if ($this->entityId) {
            $parameters['entity_id'] = $this->entityId;
        }

        if ($this->expires) {
            $parameters['expires'] = $this->expires;
        }

        return $parameters;
    }
1300600
public function jsonSerialize(): array
    {
        $returnArray = [
            'FirstName' => $this->firstName,
            'LastName' => $this->lastName,
            'Organization' => $this->organization,
            'Phone' => $this->phone,
            'Email' => $this->email,
            'Title' => $this->title,
            'Notes' => $this->notes,
        ];
        return array_filter($returnArray);
    }
840621
public function jsonSerialize()
    {
        return array_map(function($value)
        {
            if($value instanceof JsonSerialize)
                return $value->jsonSerialize();
            elseif($value instanceof  JsonInterface)
                return json_decode($value->toJson(), true);
            elseif($value instanceof ArrayInterface)
                return $value->toArray();
            else
                return $value;

        }, $this->attributes);
    }
453064
public function jsonSerialize()
    {
        $jsonErrors = $this->errors->jsonSerialize();
        $jsonWarnings = $this->warnings->jsonSerialize();

        return [
            'errors' => $jsonErrors && !empty($jsonErrors['errors']) ? $jsonErrors['errors'] : [],
            'warnings' => $jsonWarnings && !empty($jsonWarnings['errors']) ? $jsonWarnings['errors'] : [],
            'warnings' => empty($jsonWarnings['errors']) ? [] : $jsonWarnings['errors'],
            'lastDataRowIndex' => $this->lastDataRowIndex,
            'totalDataRowsProcessed' => $this->totalDataRowsProcessed,
            'importSuccessCount' => $this->importSuccessCount,
        ];
    }