/* (non-PHPdoc)
@see JsonSerializable::jsonSerialize()
354445
public function jsonSerialize()
    {
        return array(
            self::METADATA_SOURCE   => $this->metadataSource,
            self::TEMPLATE_VARIABLE => $this->templateVariable,
            self::FILES             => $this->getFiles(),
            self::DIRECTORIES       => $this->directories,
            self::NAME              => $this->name,
            self::ENVIRONNEMENT     => $this->environnement,
            self::DEPENDENCIES      => $this->dependencies,
            self::DTO               => $this->dto,
        );
    }
497780
public function jsonSerialize()
    {
        $arr = parent::jsonSerialize();
        $vars = get_object_vars($this);
        return array_merge($vars, $arr);
    }
359470
public function jsonSerialize()
    {
        $ret = new StdClass;
        foreach ($this->map as $key => $value) {
            $ret->$key = (bool)($this->source & $value);
        }
        return $ret;
    }
466821
public function jsonSerialize()
    {
        return array_filter(
            [
                'key' => $this->getKey(),
                'value' => $this->getValue()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
830982
public function jsonSerialize() { // @codingStandardsIgnoreLine (CONTRIB-6469).
        $data = parent::jsonSerialize();
        $data['horizontal'] = $this->get_horizontal();
        $data['stacked'] = $this->get_stacked();
        return $data;
    }
1142630
function jsonSerialize(): \stdClass {
    return (object) [
      'testName' => $this->getTestName(),
      'records' => array_map(function(Record $item) {
        return $item->jsonSerialize();
      }, $this->getRecords()->getArrayCopy())
    ];
  }
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;
    }
1285891
public function jsonSerialize() {
    $valid = !isset($this->preferredStartingPosition) ||
      $this->validatePreferredStartingPosition($this->preferredStartingPosition);
    if (!$valid) {
      return NULL;
    }
    return parent::jsonSerialize();
  }
392256
public function jsonSerialize() {
        $ret = new \stdClass();
        $requiredTargetAttributes = array();
        $requiredTargetAttributes['requiredTargetAttributes'] = $this->requiredTargetAttributes;
        $ret->requiredTargetAttributes = $requiredTargetAttributes;
        $ret->targetAttributes = $this->targetAttributes;

        return $ret;
    }
688064
public function jsonSerialize(): array
    {
        $outObj         = array();
        $outObj['name'] = $this->name;
        if ($this->type !== null) {
            $outObj['type'] = $this->type;
        }
        if ($this->dynamic !== null) {
            $outObj['dynamic'] = $this->dynamic;
        }
        if ($this->docs !== null) {
            $outObj['docs'] = $this->docs;
        }
        return $outObj;
    }
14144
public function jsonSerialize() {
    $valid =
      (!isset($this->initialAlpha) ||
        $this->validateInitialAlpha($this->initialAlpha)) &&
      (!isset($this->initialScale) ||
        $this->validateInitialScale($this->initialScale));
    if (!$valid) {
      return NULL;
    }
    return parent::jsonSerialize();
  }
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;
  }
1302246
public function jsonSerialize()
    {
        $r = [
            'message' => $this->getMessage(),
            'messageContainsHtml' => $this->messageContainsHtml(),
        ];
        if ($this->field) {
            $r['field'] = $this->field;
        }

        return $r;
    }
816811
public function jsonSerialize() {
    $valid = (!isset($this->textColor) ||
        $this->validateTextColor($this->textColor)) &&
      (!isset($this->backgroundColor) ||
        $this->validateBackgroundColor($this->backgroundColor));
    if (!$valid) {
      return NULL;
    }
    return parent::jsonSerialize();
  }
173538
public function jsonSerialize()
    {
        return array_merge($this->toJsonSerialize(), [
            'inheritance' => $this->inheritance,
            'abstract' => $this->isAbstract,
            'meta' => $this->meta,
            'name' => $this->name,
            '__CLASS__' => get_called_class(),
        ]);
    }
895704
public function jsonSerialize()
    {
        $jsonArray = [
            "error" => [
                "message" => $this->getMessage(),
                "code" => $this->getCode()
            ]
        ];

        if (isset($this->details)) {
            $jsonArray["error"]["details"] = $this->details;
        }

        if (isset($this->innerError)) {
            $jsonArray["error"]["innererror"] = [
                "code" => $this->innerError
            ];
        }

        return $jsonArray;
    }
267835
public function deserialize(string $json): WrapperInterface
    {
        try {
            /** @var WrapperInterface $wrapper */
            $wrapper = $this->jms()->deserialize(
                $json,
                $this->wrapperClass(),
                'json'
            );
        } catch (\Exception $e) {
            throw new \RuntimeException('Error while deserialize "' . $json . '"', 0, $e);
        }

        return $wrapper;
    }