Specify data which should be serialized to JSON

@link http://php.net/manual/en/jsonserializable.jsonserialize.php
@return mixed data which can be serialized by <b>json_encode</b>,
which is a value of any type other than a resource.
@since 5.4.0
970022
public function jsonSerialize() {
		return [
			self::JSON_KEY_GET          => $this->get,
			self::JSON_KEY_POST         => $this->post,
			self::JSON_KEY_FILES        => $this->files,
			self::JSON_KEY_COOKIE       => $this->cookie,
			self::JSON_KEY_HEADERS      => $this->HEADERS,
			self::JSON_KEY_METHOD       => $this->getRequestMethod(),
			self::JSON_KEY_INPUT        => $this->INPUT,
			self::JSON_KEY_PARSED_INPUT => $this->PARSED_INPUT,
			self::JSON_KEY_REQUEST_URI  => $this->getRequestUri(),

			self::JSON_KEY_PARSED_REQUEST_URI => $this->parsedUri,
		];
	}
757244
public function jsonSerialize()
    {
        $copy = [];
        foreach ((array)$this as $key => $value) {
            if (!is_string($value)) {
                $element = $value->getElement();
                if (is_object($element)
                    and method_exists($element, 'name')
                    and $name = $element->name()
                ) {
                    $copy[$name] = $value instanceof JsonSerializable ? $value->jsonSerialize() : $value;
                }
                $copy[$key] = $value instanceof JsonSerializable ? $value->jsonSerialize() : $value;
            } else {
                $copy[$key] = $value;
            }
        }
        return $copy;
    }
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;
    }
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(),
        ]);
    }
480814
protected function toJson()
    {
        $serializedActionResults = [];

        foreach ($this->results as $action => $result) {
            $serializedActionResults[$action] = serialize($result);
        }

        $responseData = [
            'requestId' => $this->requestId,
            'actionResults' => $serializedActionResults
        ];

        return json_encode($responseData);
    }
1016152
public function jsonSerialize()
    {
        $jsonData = [
            'identity'   => $this->identity,
            'public_key' => $this->publicKey,
            'version'    => $this->version,
            'created_at' => $this->createdAt,
        ];

        if ($this->previousCardId != null) {
            $jsonData['previous_card_id'] = $this->previousCardId;
        }

        return $jsonData;
    }
1222684
public function jsonSerialize()
    {
        $jsonData = $this->getData();
        if (isset($jsonData["_id"])) {
            $jsonData["id"] = (string)$jsonData["_id"];
            // @codeCoverageIgnoreStart
            unset($jsonData["_id"]);
            // @codeCoverageIgnoreEnd
        }
        foreach ($this->_schema as $name => $dsc) {
            if (@$dsc['hidden']) {
                // @codeCoverageIgnoreStart
                unset($jsonData[$name]);
                // @codeCoverageIgnoreEnd
            }
        }
        return $jsonData;
    }
1147553
function jsonSerialize()
    {
        $data = [
            'text' => $this->text
        ];

        if ($this->replyMarkup) {
            $data['reply_markup'] = $this->replyMarkup;
        }

        return $data;
    }
815719
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'threshold' => $this->getThreshold(),
                'post_to_url' => $this->getPostToUrl()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
1302246
public function jsonSerialize()
    {
        $r = [
            'message' => $this->getMessage(),
            'messageContainsHtml' => $this->messageContainsHtml(),
        ];
        if ($this->field) {
            $r['field'] = $this->field;
        }

        return $r;
    }
1023468
public function jsonSerialize()
    {
        return array_map(function ($value) {
            if ($value instanceof JsonSerializable) {
                return $value->jsonSerialize();
            } else {
                return $value;
            }
        }, $this->items);
    }
83716
function jsonSerialize()
	{
		return array_map(function ($value) {
			if($value instanceof JsonSerializable)
			{
				return $value->jsonSerialize();
			}
			else if($value instanceof Jsonable)
			{
				return Json::parse($this->toJson(), true);
			}
			else if($value instanceof Arrayable)
			{
				return $value->toArray();
			}
			else
			{
				return $value;
			}
		}, $this->items);
	}
576966
public function jsonSerialize()
    {
        // Encode in a way to decode in qcubed.js
        $a[Helper::JSON_OBJECT_TYPE] = 'qClosure';
        $a['func'] = $this->strBody;
        $a['params'] = $this->strParamsArray;
        return Helper::makeJsonEncodable($a);
    }
453624
public function jsonSerialize()
    {
        $allFields = parent::jsonSerialize();
        $compositeFields = CompositeDTOMapper::compositeFields(get_class($this));
        foreach ($compositeFields as $key) {
            if (isset($this->$key)) {
                $allFields[$key] = $this->resolveSubresource($key, $this->$key, $this->name());
            }
        }
        return $allFields;
    }
232311
public function jsonSerialize()
    {
        $o = [];
        foreach ($this->properties as $prop) {
            $value = $this->$prop;
            if (is_null($value)) {
                $o[$prop] = $value;
            } elseif (is_array($value)) {
                $t = [];
                foreach ($value as $k => $v) {
                    if (is_object($v)) {
                        $t[$k] = $v->jsonSerialize();
                    } else {
                        $t[$k] = (string) $v;
                    }
                }
                $o[$prop] = $t;
            } elseif (is_object($value)) {
                $o[$prop] = $value->jsonSerialize();
            } else {
                $o[$prop] = $value;
            }
        }
        return $o;
    }
382498
public function jsonSerialize()
    {
        if (static::$serializer) {
            return call_user_func(static::$serializer, $this);
        }

        $carbon = $this;

        return call_user_func(function () use ($carbon) {
            return get_object_vars($carbon);
        });
    }
121801
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();
        $json['fileSize'] = $this->getFileSize();
        $json['mimeType'] = $this->getMimeType();
        $json['fileModifiedAt'] = $this->getFileModifiedAt();
        $json['type'] = static::getType();

        return $json;
    }