Returns the decoded JSON string.

@uses json_decode()
@return array
175384
public function getDecodedJson():array
    {
        if (!($array = json_decode($this->json, true))) {
            throw new \RuntimeException("Unable to decode the response's JSON");
        }
        return json_decode($this->json, true);
    }
1200668
public function jsonSerialize()
    {
        $data = [
            'url' => $this->url
        ];

        $data = array_merge($data, $this->buildJsonAttributes([
            'certificate' => $this->certificate,
            'max_connections' => $this->maxConnections,
            'allowed_updates' => $this->allowedUpdates
        ]));

        return $data;
    }
569681
public function getJson() : ?string 
    {
        if ( ! $this->hasJson()) {
            $this->setJson($this->getDefaultJson());
        }
        return $this->json;
    }
1307735
public function getJson()
    {
        $body = $this->getBody();
        $json = json_decode($body, true);

        if (!is_array($json)) {
            if ($this->_wasAsync) {
                return [];
            }

            // should be an array, fail otherwise
            throw new ClientException('Got a malformed result from the server');
        }

        return $json;
    }
357674
public function decode($json)
    {
        $decoded = json_decode($json, true);
        if (null !== $decoded) {
            return $decoded;
        }
        if (JSON_ERROR_NONE === json_last_error()) {
            return $json;
        }

        return self::$json_errors[json_last_error()];
    }
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);
    }
834393
public function getJson()
    {
        if (!isset($this->json)) {
            $this->json = json_decode($this->getProp('dump-single-json'));
        }

        return $this->json;
    }
1227621
public function toJson()
    {
        $json = [];

        if (! empty($this->registrationIds)) {
            $json['registration_ids'] = $this->registrationIds;
        }

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

        if (! empty($this->data)) {
            $json['data'] = $this->data;
        }

        if (! empty($this->notification)) {
            $json['notification'] = $this->notification;
        }

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

        if ($this->timeToLive != 2419200) {
            $json['time_to_live'] = $this->timeToLive;
        }

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

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

        return Json::encode($json);
    }
1324983
public function toJson()
    {
        $json = null;
        if (!empty($this->toArray())) {
            $json = json_encode($this->toArray());
        }

        return $json;
    }
1296653
public function asJSON() : string
    {
        $fields = [];

        foreach($this->_data as $key => $value) {
            if(!is_object($value)) {
                $fields[$key] = $value;
            }
        }

        return json_encode($fields);
    }
712732
public function jsonSerialize()
    {
        return array_filter(
            [
                'type' => $this->getType(),
                'value' => $this->getValue()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
1257572
public function jsonSerialize(): string
    {
        $output = array($this->getLocale() => $this->data);
        return json_encode($output, JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_TAG);
    }
200427
public function getDecodedBody(): array
    {
        if ($this->decodedBody === null) {
            $decodedBody = json_decode($this->getBody(), true);
            if ($decodedBody === null || json_last_error() !== JSON_ERROR_NONE) {
                $decodedBody = [];
            }

            $this->decodedBody = $decodedBody;
        }

        return $this->decodedBody;
    }
1091527
public function json()
    {
        $field = $this;

        return $this->unescape()->as(function ($value) use ($field) {
            $content = json_decode($value, true);

            if (json_last_error() == 0) {
                $field->border = false;

                return '<pre><code>'.json_encode($content, JSON_PRETTY_PRINT).'</code></pre>';
            }

            return $value;
        });
    }
357639
public function getJson()
    {
      return json_encode(
        array(
          'name' => $this->name,
          'mime' => $this->mime,
          'height' => $this->height,
          'width' => $this->width,
          'size' => $this->_files['size'],
          'location' => $this->location,
          'fullpath' => $this->fullPath,
        )
      );
    }
1285420
public function toJson() : string
    {
        $json = json_encode($this->data);

        if (false === $json) {
            throw JsonException::fromJsonEncodeError(json_last_error_msg());
        }

        return $json;
    }
1224189
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'utm_source' => $this->getCampaignSource(),
                'utm_medium' => $this->getCampaignMedium(),
                'utm_term' => $this->getCampaignTerm(),
                'utm_content' => $this->getCampaignContent(),
                'utm_campaign' => $this->getCampaignName()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }