@param string $json

@return self
543565
public static function jsonDeserialize(string $json): self
    {
        $data = JSON::decode($json);

        if (empty($data['path'])) {
            throw new LogicException('The message does not contain "path" but it is required.');
        }

        if (empty($data['uris'])) {
            throw new LogicException('The message uris must not be empty array.');
        }

        return new static($data['path'], $data['uris']);
    }
863330
public static function fromJson($json)
    {
        $responseData = json_decode($json, true);

        if ( ! $responseData)
            return new static(false, [ResponseV3::E_INVALID_JSON]);

        return static::fromArray($responseData);
    }
966954
public static function fromJson($json)
    {
        $data = json_decode((string)$json, true);

        if (json_last_error() !== JSON_ERROR_NONE || !is_array($data)) {
            throw new \UnexpectedValueException('Invalid JSON message.');
        }

        return new static($data);
    }
1138661
public static function fromJson($json){
    if(is_string($json)){
      $json = json_decode($json);
    }

    if(!property_exists($json, 'error')){
      throw new BadResponseException('Required parameter "error" not found');
    }
    
    if(is_null($json->error)){
      $shortReport = ShortReport::fromJson($json);

      if(!property_exists($json, 'payload')){
        throw new BadResponseException('Required parameter "payload" not found');
      }
      if(!property_exists($json, 'group_code')){
        throw new BadResponseException('Required parameter "group_code" not found');
      }
      if(!property_exists($json, 'daemon_code')){
        throw new BadResponseException('Required parameter "daemon_code" not found');
      }
      if(!property_exists($json, 'device_code')){
        throw new BadResponseException('Required parameter "device_code" not found');
      }
      if(!property_exists($json, 'callback_url')){
        throw new BadResponseException('Required parameter "callback_url" not found');
      }

      $payload = Payload::fromJson($json->payload);
      return new self(
        $shortReport->getUuid(),
        $shortReport->getTimestamp(),
        $shortReport->getStatus(),
        $payload,
        $json->group_code,
        $json->daemon_code,
        $json->device_code,
        $json->callback_url
      );
    }
    else{
      if(!property_exists($json->error, 'code')){
        throw new BadResponseException('Required parameter "error.code" not found');
      }

      throw AbstractReport::errorToException((int) $json->error->code);
    }
  }
435271
public function setRequest(JsonRequest $request)
    {
        $this->id = $request->getId();
        $this->jsonrpc = $request->getJsonrpc();
        $this->method = $request->getMethod();
        $this->request = $request;

        if (!$request->getResponse()) {
            $request->setResponse($this);
        }

        return $this;
    }
1364809
public static function fromJson($json)
    {
        if (!is_object($json)) {
            $json = json_decode($json);
        }
        $properties = ['package', 'description', 'url', 'sha1', 'depth'];
        $patch = new static();

        foreach ($properties as $property) {
            if (isset($json->{$property})) {
                $patch->{$property} = $json->{$property};
            }
        }

        return $patch;
    }
618781
public function setJson($json)
    {
        global $CFG, $PDOX;

        $q = $PDOX->queryDie("UPDATE {$CFG->dbprefix}{$this->TABLE_NAME}
                SET json = :SET WHERE $this->PRIMARY_KEY = :PK",
            array(":SET" => $json, ":PK" => $this->id)
        );
    }
146423
public static function jsonToArray($json = false) {

        if ($json && Validate::isJson($json)) {

            $object = json_decode($json);
            return self::objectToArray($object);
        }

        return false;
    }
506388
public function json($data)
    {
        $json = $this->isJson($data, true);

        if ($json) {
            return $this->collect($json);
        }

        return $this;
    }
347073
static function fromJson(object $map): self {
    return new static(
      isset($map->name) && is_string($map->name) ? $map->name : '',
      isset($map->source_digest) && is_string($map->source_digest) ? $map->source_digest : '',
      isset($map->source) && is_string($map->source) ? $map->source : '',
      isset($map->coverage) && is_array($map->coverage) ? $map->coverage : []
    );
  }
953623
public static function create(array $json)
    {
        $unregisterDeviceResponse = new UnregisterDeviceResponse();
        $unregisterDeviceResponse->setStatusCode($json['status_code']);
        $unregisterDeviceResponse->setStatusMessage($json['status_message']);

        return $unregisterDeviceResponse;
    }
764487
public static function createFromJson(string $json): self
    {
        $data = \json_decode($json, true);
        if (!\is_array($data)) {
            throw new InvalidArgumentException('Invalid argument.');
        }

        return self::createFromKeyData($data);
    }
1318592
public static function create(array $json)
    {
        $deleteMessageResponse = new DeleteMessageResponse();
        $deleteMessageResponse->setStatusCode($json['status_code']);
        $deleteMessageResponse->setStatusMessage($json['status_message']);

        return $deleteMessageResponse;
    }
763612
public function remove(string $key): self
    {
        $this->data = Arr::remove($this->data, $key);
        return $this;
    }
1067285
public function setJson($data)
    {
        if (is_array($data)) {
            $this->_json = $data;
        } elseif (is_string($data)) {
            $this->_json = ['code' => 1, 'message' => $data];
        } elseif (is_int($data)) {
            $this->_json = ['code' => $data, 'message' => $this->getMessage()];
        } else {
            $this->_json = $data;
        }

        return $this;
    }
869233
public static function create($json)
    {
        $entity = json_decode($json);

        if (is_null($entity)) {
            throw new \InvalidArgumentException("Invalid JSON", 1);
        }

        if (!isset($entity->object) || $entity->object != 'event') {
            throw new \InvalidArgumentException("Entity is not an event", 2);
        }

        $modelClass = self::getModelClassFromEventType($entity->type);

        return new $modelClass($json);
    }
25194
protected function _addQueryLogsNode($json)
    {
        $listener = $this->_getApiQueryLogListenerObject();
        $logs = $listener->getQueryLogs();

        if (empty($logs)) {
            return $json;
        }

        $result = json_decode($json, true);
        $result['query'] = $logs;

        return json_encode($result, JSON_PRETTY_PRINT);
    }