Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions webapp/src/Controller/API/JudgehostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ public function addJudgingRunAction(
}

$runResult = $request->request->get('runresult');
$startTime = (float)$request->request->get('start_time');
$endTime = (float)$request->request->get('end_time');
$startTime = $request->request->get('start_time');
$endTime = $request->request->get('end_time');
$runTime = $request->request->get('runtime');
$outputRun = $request->request->get('output_run');
$outputDiff = $request->request->get('output_diff');
Expand Down Expand Up @@ -926,8 +926,8 @@ private function addSingleJudgingRun(
string $hostname,
string $runResult,
string $runTime,
float $startTime,
float $endTime,
string $startTime,
string $endTime,
string $outputSystem,
string $outputError,
string $outputDiff,
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/AuditLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AuditLog
scale: 9,
options: ['comment' => 'Timestamp of the logentry', 'unsigned' => true]
)]
private float $logtime;
private string|float $logtime;

#[ORM\Column(
nullable: true,
Expand Down Expand Up @@ -70,13 +70,13 @@ public function getLogid(): ?int
return $this->logid;
}

public function setLogtime(float $logtime): AuditLog
public function setLogtime(string|float $logtime): AuditLog
{
$this->logtime = $logtime;
return $this;
}

public function getLogtime(): float
public function getLogtime(): string|float
{
return $this->logtime;
}
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/Clarification.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Clarification extends BaseApiEntity implements
options: ['comment' => 'Time sent', 'unsigned' => true]
)]
#[Serializer\Exclude]
private float $submittime;
private string|float $submittime;

#[ORM\Column(nullable: true, options: ['comment' => 'Name of jury member who answered this'])]
#[Serializer\Exclude]
Expand Down Expand Up @@ -145,13 +145,13 @@ public function getExternalid(): ?string
return $this->externalid;
}

public function setSubmittime(float $submittime): Clarification
public function setSubmittime(string|float $submittime): Clarification
{
$this->submittime = $submittime;
return $this;
}

public function getSubmittime(): float
public function getSubmittime(): string|float
{
return $this->submittime;
}
Expand Down
32 changes: 16 additions & 16 deletions webapp/src/Entity/Contest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
options: ['comment' => 'Time contest becomes visible in team/public views', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $activatetime;
private string|float|null $activatetime;

#[ORM\Column(
type: 'decimal',
Expand All @@ -92,7 +92,7 @@
options: ['comment' => 'Time contest starts, submissions accepted', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $starttime = null;
private string|float|null $starttime = null;

#[ORM\Column(options: [
'comment' => 'If disabled, starttime is not used, e.g. to delay contest start',
Expand All @@ -109,7 +109,7 @@
options: ['comment' => 'Time scoreboard is frozen', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $freezetime = null;
private string|float|null $freezetime = null;

#[ORM\Column(
type: 'decimal',
Expand All @@ -118,7 +118,7 @@
options: ['comment' => 'Time after which no more submissions are accepted', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $endtime;
private string|float|null $endtime;

#[ORM\Column(
type: 'decimal',
Expand All @@ -128,7 +128,7 @@
options: ['comment' => 'Unfreeze a frozen scoreboard at this time', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $unfreezetime = null;
private string|float|null $unfreezetime = null;

#[ORM\Column(
type: 'decimal',
Expand All @@ -138,7 +138,7 @@
options: ['comment' => 'Time when contest was finalized, null if not yet', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $finalizetime = null;
private string|float|null $finalizetime = null;

#[ORM\Column(
type: 'text',
Expand Down Expand Up @@ -213,7 +213,7 @@
options: ['comment' => 'Time contest becomes invisible in team/public views', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $deactivatetime = null;
private string|float|null $deactivatetime = null;

#[ORM\Column(
length: 64,
Expand Down Expand Up @@ -513,7 +513,7 @@
return $this->activatetime === null ? null : (float)$this->activatetime;
}

public function setStarttime(float $starttime): Contest
public function setStarttime(string|float $starttime): Contest
{
$this->starttime = $starttime;
return $this;
Expand Down Expand Up @@ -581,7 +581,7 @@
return $this->finalizetime === null ? null : (float)$this->finalizetime;
}

public function setFinalizetime(?float $finalizetimeString): Contest
public function setFinalizetime(string|float|null $finalizetimeString): Contest
{
$this->finalizetime = $finalizetimeString;
return $this;
Expand Down Expand Up @@ -699,31 +699,31 @@
return $this->deactivatetimeString;
}

public function setActivatetime(float $activatetime): Contest
public function setActivatetime(string|float|null $activatetime): Contest
{
$this->activatetime = $activatetime;
return $this;
}

public function setFreezetime(float $freezetime): Contest
public function setFreezetime(string|float $freezetime): Contest
{
$this->freezetime = $freezetime;
return $this;
}

public function setEndtime(float $endtime): Contest
public function setEndtime(string|float $endtime): Contest
{
$this->endtime = $endtime;
return $this;
}

public function setUnfreezetime(float $unfreezetime): Contest
public function setUnfreezetime(string|float $unfreezetime): Contest
{
$this->unfreezetime = $unfreezetime;
return $this;
}

public function setDeactivatetime(float $deactivatetime): Contest
public function setDeactivatetime(string|float $deactivatetime): Contest
{
$this->deactivatetime = $deactivatetime;
return $this;
Expand Down Expand Up @@ -1042,7 +1042,7 @@
($this->deactivatetime == null || $this->deactivatetime > time());
}

public function getAbsoluteTime(?string $time_string): float|int|null
public function getAbsoluteTime(?string $time_string): string|float|int|null
{
if ($time_string === null) {
return null;
Expand Down Expand Up @@ -1073,7 +1073,7 @@
} catch (Exception) {
return null;
}
return (float)$date->format('U.v');
return $date->format('U.v');
}
}

Expand Down Expand Up @@ -1277,7 +1277,7 @@
{
foreach (['Activate', 'Deactivate', 'Start', 'End', 'Freeze', 'Unfreeze'] as $timeString) {
$tmpValue = $this->{'get' . $timeString . 'timeString'}();
if ($tmpValue === null) continue;

Check failure on line 1280 in webapp/src/Entity/Contest.php

View workflow job for this annotation

GitHub Actions / phpcs

Inline control structures are not allowed
try {
$this->checkValidTimeString($tmpValue);
} catch (Exception $e) {
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Event
scale: 9,
options: ['comment' => 'When the event occurred', 'unsigned' => true]
)]
private float $eventtime;
private string|float $eventtime;

#[ORM\Column(length: 32, options: ['comment' => 'API endpoint associated to this entry'])]
private string $endpointtype;
Expand Down Expand Up @@ -64,13 +64,13 @@ public function getEventid(): int
return $this->eventid;
}

public function setEventtime(float $eventtime): Event
public function setEventtime(string|float $eventtime): Event
{
$this->eventtime = $eventtime;
return $this;
}

public function getEventtime(): float
public function getEventtime(): string|float
{
return $this->eventtime;
}
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/ExternalContestSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExternalContestSource
nullable: true,
options: ['comment' => 'Time of last poll by event feed reader', 'unsigned' => true]
)]
private ?float $lastPollTime = null;
private string|float|null $lastPollTime = null;

#[ORM\Column(
type: 'smallint',
Expand Down Expand Up @@ -139,12 +139,12 @@ public function setLastEventId(?string $lastEventId): ExternalContestSource
return $this;
}

public function getLastPollTime(): float|null
public function getLastPollTime(): string|float|null
{
return $this->lastPollTime;
}

public function setLastPollTime(?float $lastPollTime): ExternalContestSource
public function setLastPollTime(string|float|null $lastPollTime): ExternalContestSource
{
$this->lastPollTime = $lastPollTime;
return $this;
Expand Down
12 changes: 6 additions & 6 deletions webapp/src/Entity/ExternalJudgement.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ExternalJudgement
scale: 9,
options: ['comment' => 'Time judging started', 'unsigned' => true]
)]
private float $starttime;
private string|float $starttime;

#[ORM\Column(
type: 'decimal',
Expand All @@ -77,7 +77,7 @@ class ExternalJudgement
nullable: true,
options: ['comment' => 'Time judging ended, null = still busy', 'unsigned' => true]
)]
private ?float $endtime = null;
private string|float|null $endtime = null;

#[ORM\Column(
options: ['comment' => 'Old external judgement is marked as invalid when receiving a new one', 'default' => 1]
Expand Down Expand Up @@ -163,24 +163,24 @@ public function getVerifyComment(): ?string
return $this->verify_comment;
}

public function setStarttime(float $starttime): ExternalJudgement
public function setStarttime(string|float $starttime): ExternalJudgement
{
$this->starttime = $starttime;
return $this;
}

public function getStarttime(): float
public function getStarttime(): string|float
{
return $this->starttime;
}

public function setEndtime(?float $endtime): ExternalJudgement
public function setEndtime(string|float|null $endtime): ExternalJudgement
{
$this->endtime = $endtime;
return $this;
}

public function getEndtime(): float|null
public function getEndtime(): string|float|null
{
return $this->endtime;
}
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/ExternalRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ExternalRun
scale: 9,
options: ['comment' => 'Time run ended', 'unsigned' => true]
)]
private float $endtime;
private string|float $endtime;

#[ORM\Column(options: ['comment' => 'Running time on this testcase'])]
private float $runtime;
Expand Down Expand Up @@ -89,13 +89,13 @@ public function getResult(): string
return $this->result;
}

public function setEndtime(float $endtime): ExternalRun
public function setEndtime(string|float $endtime): ExternalRun
{
$this->endtime = $endtime;
return $this;
}

public function getEndtime(): float
public function getEndtime(): string|float
{
return $this->endtime;
}
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/InternalError.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class InternalError
scale: 9,
options: ['comment' => 'Timestamp of the internal error', 'unsigned' => true]
)]
private float $time;
private string|float $time;

/**
* @var array{kind: string, hostname?: string, execid?: string, probid: string, langid: string}
Expand Down Expand Up @@ -118,13 +118,13 @@ public function getJudgehostlog(): string
return $this->judgehostlog;
}

public function setTime(float $time): InternalError
public function setTime(string|float $time): InternalError
{
$this->time = $time;
return $this;
}

public function getTime(): float
public function getTime(): string|float
{
return $this->time;
}
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Entity/JudgeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getSubmitid(): ?int
options: ['comment' => 'Time the judgetask was started', 'unsigned' => true]
)]
#[Serializer\Exclude]
private ?float $starttime = null;
private string|float|null $starttime = null;

/**
* @var Collection<int, JudgingRun>
Expand Down Expand Up @@ -341,13 +341,13 @@ public function getValid(): bool
return $this->valid;
}

public function setStarttime(?float $starttime): JudgeTask
public function setStarttime(string|float|null $starttime): JudgeTask
{
$this->starttime = $starttime;
return $this;
}

public function getStarttime(): float|null
public function getStarttime(): string|float|null
{
return $this->starttime;
}
Expand Down
Loading
Loading