id; } public function jsonSerialize(): mixed { $json = [ 'lifetime' => [ 'creationTime' => $this->startTime->toIso8601ZuluString(), 'expirationTime' => $this->endTime->toIso8601ZuluString(), ], 'challengeType' => $this->type, 'challengeId' => $this->getChallengeId(), 'challengeCompletionValue' => $this->completionValue, 'faction' => $this->faction, 'challengeBlueprint' => $this->challengeBlueprint, ]; $rewards = []; foreach ($this->rewards as &$reward) { $reward['claimed'] = $this->claimed; $reward['weight'] = 100; $rewards[] = $reward; } $json['rewards'] = $rewards; return $json; } }