Skip to content

Commit 5d4615c

Browse files
committed
fix tests & remove DB
1 parent e3c21c6 commit 5d4615c

35 files changed

+63
-101
lines changed

app/Components/ApiResults/ApiResultsComponent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function serialiseResults(): array
7474
}
7575
if (!$data['times']['visible']) {
7676
// results are hidden
77-
$data["submits"] = null;
78-
foreach ($data["teams"] as &$team) {
79-
$team["bonus"] = null;
77+
$data['submits'] = null;
78+
foreach ($data['teams'] as &$team) {
79+
$team['bonus'] = null;
8080
}
8181
}
8282
return $data;

app/Components/Map/MapComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function processTeams(): void
4343
$this->teamCountries = [];
4444

4545
foreach ($this->serviceTeam->getTeams($this->forEventId) as $team) {
46-
if (!in_array($team->status, ["participated", "disqualified", "applied", "pending", "approved"])) {
46+
if (!in_array($team->status, ['participated', 'disqualified', 'applied', 'pending', 'approved'])) {
4747
continue;
4848
}
4949
$this->teamCount++;

app/Components/PdfGallery/PdfGalleryControl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function getPdfs($path, $wwwDir): array
4343
$wwwPath = substr($file->getPathname(), strlen($wwwDir));
4444
$pdfs[] = [
4545
'src' => $wwwPath,
46-
'name' => $file->getBasename(".pdf"),
46+
'name' => $file->getBasename('.pdf'),
4747
];
4848
}
4949

app/Components/UpperHomePrague/UpperHomePrague.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function render(): void
3232
{
3333
$this->template->lang = $this->getPresenter()->lang;
3434
$this->template->gamePhaseCalculator = $this->gamePhaseCalculator;
35-
$this->template->render(__DIR__ . DIRECTORY_SEPARATOR . "upperHomePrague.latte");
35+
$this->template->render(__DIR__ . DIRECTORY_SEPARATOR . 'upperHomePrague.latte');
3636
}
3737

3838
protected function createComponentCountdown(): CountdownComponent

app/Models/Game/Connector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public function getResults(): array
3737
return $this->getCache()->load('results', function (?array &$dependencies): array {
3838
$context = null;
3939
if ($this->httpAuthUser) {
40-
$auth = base64_encode($this->httpAuthUser . ":" . $this->httpAuthPassword);
40+
$auth = base64_encode($this->httpAuthUser . ':' . $this->httpAuthPassword);
4141
$context = stream_context_create([
42-
"http" => [
43-
"header" => "Authorization: Basic $auth"
42+
'http' => [
43+
'header' => "Authorization: Basic $auth"
4444
]
4545
]);
4646
}

app/Models/GamePhaseCalculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function isGame(int $period = self::NOW): bool
9191
return $this->checkEvent(
9292
$period,
9393
$this->getGameBegin(),
94-
$this->getGameBegin()->add(new \DateInterval("PT3H")),
94+
$this->getGameBegin()->add(new \DateInterval('PT3H')),
9595
);
9696
}
9797

app/Modules/Core/BasePresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function localize(): void
7373
{
7474
// Lang is null in error presenter because no rote rule was applied
7575
if (!isset($this->lang) || $this->lang == null) {
76-
$this->lang = "en"; // todo guess language by domain
76+
$this->lang = 'en'; // todo guess language by domain
7777
}
7878

7979
$this->translator->setLang($this->lang);

app/Modules/Dsef/ArchiveModule/BasePresenter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function getEvent(): ModelEvent
4242
$year = $this->eventYear;
4343
$month = $this->eventMonth;
4444
$events = $this->serviceEvent->getEventsByYear(
45-
[$this->context->getParameters()["eventTypeId"]],
45+
[$this->context->getParameters()['eventTypeId']],
4646
intval($year)
4747
);
4848
$events = array_filter($events, function ($event) use ($month) {
@@ -99,20 +99,20 @@ protected function getNavItems(): array
9999
$items = [];
100100
if (RegistrationPresenter::isVisible($this->gamePhaseCalculator)) {
101101
$items[] = new NavItem(
102-
new PageTitle(null, "Registrace", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
102+
new PageTitle(null, 'Registrace', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
103103
':Default:Registration:',
104104
);
105105
}
106106

107107
if (CurrentPresenter::isVisible($this->gamePhaseCalculator)) {
108108
$items[] = new NavItem(
109-
new PageTitle(null, "Aktuální ročník", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
109+
new PageTitle(null, 'Aktuální ročník', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
110110
':Default:Current:',
111111
);
112112
}
113113

114114
$items[] = new NavItem(
115-
new PageTitle(null, "Archiv", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
115+
new PageTitle(null, 'Archiv', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
116116
':Default:Archive:default',
117117
);
118118
return $items;

app/Modules/Dsef/Core/BasePresenter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function getEventKey(ModelEvent $event): string
2727

2828
protected function localize(): void
2929
{
30-
$this->lang = "cs";
30+
$this->lang = 'cs';
3131
parent::localize();
3232
}
3333

@@ -38,15 +38,15 @@ protected function getNavItems(): array
3838
{
3939
$items = [];
4040
$items[] = new NavItem(
41-
new PageTitle(null, "Registrace", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
41+
new PageTitle(null, 'Registrace', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
4242
'Registration:',
4343
);
4444
$items[] = new NavItem(
45-
new PageTitle(null, "Aktuální ročník", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
45+
new PageTitle(null, 'Aktuální ročník', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
4646
'Current:',
4747
);
4848
$items[] = new NavItem(
49-
new PageTitle(null, "Minulé ročníky", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
49+
new PageTitle(null, 'Minulé ročníky', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
5050
'Archive:',
5151
);
5252

app/Modules/Dsef/DefaultModule/ArchivePresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function injectServiceEvent(ServiceEventList $serviceEvent): void
2020
*/
2121
public function renderDefault(): void
2222
{
23-
$events = array_reverse($this->serviceEvent->getEvents([$this->context->getParameters()["eventTypeId"]]));
23+
$events = array_reverse($this->serviceEvent->getEvents([$this->context->getParameters()['eventTypeId']]));
2424
$events = array_filter($events, function ($event) {
2525
//return true;
2626
return $event->end < new \DateTime('now');

0 commit comments

Comments
 (0)