Converts this object to a map in JSON format.
@return \stdClass The map in JSON format corresponding to this object.
345262
function jsonSerialize(): \stdClass {
    $map = new \stdClass;
    $map->id = $this->getId();
    if (mb_strlen($authorEmail = $this->getAuthorEmail())) $map->author_email = $authorEmail;
    if (mb_strlen($authorName = $this->getAuthorName())) $map->author_name = $authorName;
    if (mb_strlen($committerEmail = $this->getCommitterEmail())) $map->committer_email = $committerEmail;
    if (mb_strlen($committerName = $this->getCommitterName())) $map->committer_name = $committerName;
    if (mb_strlen($message = $this->getMessage())) $map->message = $message;
    return $map;
  }
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;
	}
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;
    }
240631
public function toJson()
    {
        $json = array();

        $json['name'] = $this->getName();
        $json['privacy'] = $this->getPrivacy();
        //Parameters for PUT call (Room already exists)
        if ($this->getId()) {
            $json['is_archived'] = $this->isArchived();
            $json['is_guest_accessible'] = $this->isGuestAccessible();
            $json['topic'] = $this->getTopic();
            $json['owner'] = array('id' => $this->getOwner()->getId());
        } else { //Paramters for POST call
            $json['guest_access'] = $this->isGuestAccessible();
            if ($this->getOwner()) {
                $json['owner_user_id'] = $this->getOwner()->getId();
            }
        }
        return $json;
    }
244990
public function toJSON(): string
    {
        $this->internalDataListUpdate();

        // Copied from DataObjectToJSONTrait. Do not modify here !!!
        $toJSON = function($object): string {
            $result = [];

            $vars = get_object_vars($object);
            foreach ($vars as $name => $value) {
                if ($name !== 'internalDataObjectData') {
                    $reflectionProperty = new \ReflectionProperty($object, $name);
                    if ($reflectionProperty->isPublic()) {
                        $result[$name] = null;
                    }
                }
            }
            $propertiesToEncode = [];
            if (isset($object->internalDataObjectData)) {
                foreach ($object->internalDataObjectData as $name => $value) {
                    $result[substr($name, 1)] = null;
                    if (substr($name, 0, 1) === 'p' && isset($value[7])) { // encodeInJSON is set
                        $propertiesToEncode[substr($name, 1)] = true;
                    }
                }
            }
            ksort($result);
            foreach ($result as $name => $null) {
                $value = $object instanceof \ArrayAccess ? $object[$name] : (isset($object->$name) ? $object->$name : null);
                if (method_exists($value, 'toJSON')) {
                    $result[$name] = $value->toJSON();
                } else {
                    if ($value instanceof \DateTime) {
                        $value = $value->format('c');
                    }
                    if (isset($propertiesToEncode[$name]) && $value !== null) {
                        if (is_string($value)) {
                            $value = 'data:;base64,' . base64_encode($value);
                        } else {
                            throw new \Exception('The value of the ' . $name . ' property cannot be JSON encoded. It must be of type string!');
                        }
                    }
                    $result[$name] = json_encode($value);
                    if ($result[$name] === false) {
                        throw new \Exception('Invalid characters in ' . $name . '! Cannot JSON encode the value: ' . print_r($value, true));
                    }
                }
            }
            $json = '';
            foreach ($result as $name => $value) {
                $json .= '"' . addcslashes($name, '"\\') . '":' . $value . ',';
            }
            $json = '{' . rtrim($json, ',') . '}';
            return $json;
        };

        $json = '';
        foreach ($this->internalDataListData as $index => $object) {
            $object = $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $index);
            if (method_exists($object, 'toJSON')) {
                $json .= $object->toJSON() . ',';
            } else {
                $json .= $toJSON($object) . ',';
            }
        }
        $json = '[' . rtrim($json, ',') . ']';
        return $json;
    }
893497
public function mapToJSON(){
        $returnValue = null;

        $mapping = $this->getMapping();
        if(count($mapping)){
            $returnValue = Array();
            $returnValue['identifier'] = $this->getIdentifier();
            $returnValue['defaultValue'] = $this->mappingDefaultValue;
            if($this->hasAttribute('areaMapping')){
                $returnValue = array_merge($returnValue, $this->getAttributeValue('areaMapping'));
            }
            $mappingValue = Array();

            // If a mapping has been defined
            if(!empty($mapping)){
                foreach($mapping as $mapKey => $mappedValue){
                    $mapEntryJSON = Array();
                    $mapEntryJSON['value'] = (float) $mappedValue;
                    $mapEntryJSON['key'] = taoQTI_models_classes_Matching_VariableFactory::createJSONValueFromQTIData($mapKey, $this->getAttributeValue('baseType'));
                    array_push($mappingValue, (object) $mapEntryJSON);
                }

                $returnValue['value'] = $mappingValue;
            }

            $returnValue = (object) $returnValue;
        }

        return $returnValue;
    }
986105
public function generateJson()
    {
        $sourceMap = array();
        $mappings  = $this->generateMappings();

        // File version (always the first entry in the object) and must be a positive integer.
        $sourceMap['version'] = self::VERSION;

        // An optional name of the generated code that this source map is associated with.
        $file = $this->options['sourceMapFilename'];

        if ($file) {
            $sourceMap['file'] = $file;
        }

        // An optional source root, useful for relocating source files on a server or removing repeated values in the
        // 'sources' entry. This value is prepended to the individual entries in the 'source' field.
        $root = $this->options['sourceRoot'];

        if ($root) {
            $sourceMap['sourceRoot'] = $root;
        }

        // A list of original sources used by the 'mappings' entry.
        $sourceMap['sources'] = array();

        foreach ($this->sources as $source_uri => $source_filename) {
            $sourceMap['sources'][] = $this->normalizeFilename($source_filename);
        }

        // A list of symbol names used by the 'mappings' entry.
        $sourceMap['names'] = array();

        // A string with the encoded mapping data.
        $sourceMap['mappings'] = $mappings;

        if ($this->options['outputSourceFiles']) {
            // An optional list of source content, useful when the 'source' can't be hosted.
            // The contents are listed in the same order as the sources above.
            // 'null' may be used if some original sources should be retrieved by name.
            $sourceMap['sourcesContent'] = $this->getSourcesContent();
        }

        // less.js compat fixes
        if (count($sourceMap['sources']) && empty($sourceMap['sourceRoot'])) {
            unset($sourceMap['sourceRoot']);
        }

        return json_encode($sourceMap);
    }
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);
    }
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);
    }
191839
public function serialize() {
		return $this->map(function( $val ) {
			if ( $val instanceof Serializes ) {
				$val = $val->serialize();
			}

			return $val;
		})->to_array();
	}
674233
public function jsonSerialize()
    {
        return array_map(function ($value) {
            if ($value instanceof JsonSerializable) {
                return $value->jsonSerialize();
            }
            else if ($value instanceof Jsonable) {
                return json_decode($value->toJson(), true);
            }
            else if ($value instanceof Arrayable) {
                return $value->toArray();
            }
            else {
                return $value;
            }
        }, $this->items);
    }
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;
  }
996608
function jsonSerialize(): \stdClass {
    return (object) [
      'lineNumber' => $this->getLineNumber(),
      'blockNumber' => $this->getBlockNumber(),
      'branchNumber' => $this->getBranchNumber(),
      'taken' => $this->getTaken()
    ];
  }
988571
public function serialize()
    {
        return json_encode(
            array(
                self::KEY_STATE => $this->jsonableStates,
                self::KEY_TRANSITION => $this->jsonableTransitions
            )
        );
    }
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;
    }
333999
public function json() : string
    {
        return json_encode([
            'title' => $this->title,
            'body' => $this->body,
            'url' => $this->url,
            'icon' => $this->icon,
        ]);
    }
137951
public function to_json() {
		parent::to_json();

		$this->json['palette']          = $this->palette;
		$this->json['choices']['alpha'] = ( isset( $this->choices['alpha'] ) && $this->choices['alpha'] ) ? 'true' : 'false';
		$this->json['mode']             = $this->mode;
		$this->json['defaultPalette']   = 			[
			[
				'name'  => esc_attr__( 'Pale Pink', 'kirki' ),
				'slug'  => 'pale-pink',
				'color' => '#f78da7',
			],
			[
				'name'  => esc_attr__( 'Vivid Red', 'kirki' ),
				'slug'  => 'vivid-red',
				'color' => '#cf2e2e',
			],
			[
				'name'  => esc_attr__( 'Luminous Vivid Orange', 'kirki' ),
				'slug'  => 'luminous-vivid-orange',
				'color' => '#ff6900',
			],
			[
				'name'  => esc_attr__( 'Luminous Vivid Amber', 'kirki' ),
				'slug'  => 'luminous-vivid-amber',
				'color' => '#fcb900',
			],
			[
				'name'  => esc_attr__( 'Light Green Cyan', 'kirki' ),
				'slug'  => 'light-green-cyan',
				'color' => '#7bdcb5',
			],
			[
				'name'  => esc_attr__( 'Vivid Green Cyan', 'kirki' ),
				'slug'  => 'vivid-green-cyan',
				'color' => '#00d084',
			],
			[
				'name'  => esc_attr__( 'Pale Cyan Blue', 'kirki' ),
				'slug'  => 'pale-cyan-blue',
				'color' => '#8ed1fc',
			],
			[
				'name'  => esc_html__( 'Vivid Cyan Blue', 'kirki' ),
				'slug'  => 'vivid-cyan-blue',
				'color' => '#0693e3',
			],
			[
				'name'  => esc_attr__( 'White', 'kirki' ),
				'slug'  => 'theme-white',
				'color' => '#fff',
			],
			[
				'name'  => esc_attr__( 'Very Light Gray', 'kirki' ),
				'slug'  => 'very-light-gray',
				'color' => '#eee',
			],
			[
				'name'  => esc_html__( 'Cyan Bluish Gray', 'kirki' ),
				'slug'  => 'cyan-bluish-gray',
				'color' => '#abb8c3',
			],
			[
				'name'  => esc_attr__( 'Blue Gray', 'kirki' ),
				'slug'  => 'blue-gray',
				'color' => '#546E7A',
			],
			[
				'name'  => esc_attr__( 'Very Dark Gray', 'kirki' ),
				'slug'  => 'very-dark-gray',
				'color' => '#313131',
			],
			[
				'name'  => esc_attr__( 'Black', 'kirki' ),
				'slug'  => 'theme-black',
				'color' => '#000',
			],
		];
	}