Card Colors: | ';
diff --git a/gatherling/util/scryfallsync.php b/gatherling/util/scryfallsync.php
index 5f2b6902..48be2b07 100644
--- a/gatherling/util/scryfallsync.php
+++ b/gatherling/util/scryfallsync.php
@@ -2,7 +2,7 @@
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
-require_once __DIR__ . '/../lib.php';
+require_once __DIR__.'/../lib.php';
function info($text, $newline = true)
{
@@ -170,10 +170,10 @@ function insertCard($card, $set, $typeline, $stmt)
$name = $card->name;
$name = normaliseCardName($name);
echo '';
- echo 'Name: | ' . $name . ' | ';
+ echo 'Name: | '.$name.' | ';
foreach (['manaCost', 'convertedManaCost', 'type', 'rarity'] as $attr) {
if (isset($card->{$attr})) {
- echo "{$attr}: | " . $card->{$attr} . ' | ';
+ echo "{$attr}: | ".$card->{$attr}.' | ';
}
}
echo 'Card Colors: | ';
diff --git a/gatherling/util/time.php b/gatherling/util/time.php
index 16c964c3..51165266 100644
--- a/gatherling/util/time.php
+++ b/gatherling/util/time.php
@@ -2,7 +2,7 @@
function time_element($datetime, $now): string
{
- return '';
+ return '';
}
function human_date($datetime, $now): string
@@ -19,19 +19,20 @@ function human_date($datetime, $now): string
}
$suffix = $datetime > $now ? 'from now' : 'ago';
$INTERVALS = [
- 'week' => 60 * 60 * 24 * 7,
- 'day' => 60 * 60 * 24,
- 'hour' => 60 * 60,
+ 'week' => 60 * 60 * 24 * 7,
+ 'day' => 60 * 60 * 24,
+ 'hour' => 60 * 60,
'minute' => 60,
'second' => 1,
];
foreach ($INTERVALS as $interval => $duration) {
if ($elapsed > $duration) {
- return pluralize(intdiv($elapsed, $duration), $interval) . " $suffix";
+ return pluralize(intdiv($elapsed, $duration), $interval)." $suffix";
}
}
}
-function pluralize($n, $noun): string {
- return $n . ' ' . $noun . ($n != 1 ? 's' : '');
+function pluralize($n, $noun): string
+{
+ return $n.' '.$noun.($n != 1 ? 's' : '');
}
diff --git a/gatherling/util/updateDefaultFormats.php b/gatherling/util/updateDefaultFormats.php
index 50a04551..6be7beda 100644
--- a/gatherling/util/updateDefaultFormats.php
+++ b/gatherling/util/updateDefaultFormats.php
@@ -2,7 +2,7 @@
namespace Gatherling;
-require_once __DIR__ . '/../lib.php';
+require_once __DIR__.'/../lib.php';
if (PHP_SAPI != 'cli' && $_SERVER['REQUEST_METHOD'] == 'GET') { // unauthorized POST is okay
ini_set('max_execution_time', 300);
diff --git a/tests/EventsTest.php b/tests/EventsTest.php
index 2b61c197..e798eef3 100644
--- a/tests/EventsTest.php
+++ b/tests/EventsTest.php
@@ -26,7 +26,7 @@ public function testSeriesCreation()
$series = new Series('');
$series->name = 'Test';
$series->active = true;
- $series->start_time = '00:00' . ':00';
+ $series->start_time = '00:00'.':00';
$series->start_day = 'Friday';
$series->save();
}
@@ -107,7 +107,7 @@ public function testEventCreation($series)
public function testRegistration($event)
{
for ($i = 0; $i < 10; $i++) {
- $event->addPlayer('testplayer' . $i);
+ $event->addPlayer('testplayer'.$i);
}
// 8 players have expressed interest in the event.
$this->assertEquals(10, count($event->getEntries()));
diff --git a/tests/TimeTest.php b/tests/TimeTest.php
index 03914146..6916f600 100644
--- a/tests/TimeTest.php
+++ b/tests/TimeTest.php
@@ -11,26 +11,26 @@ final class TimeTest extends TestCase
public function testHumanDate()
{
$now = strtotime('2024-08-29T12:00:00-07:00');
- $this->assertEquals("just now", human_date($now, $now));
+ $this->assertEquals('just now', human_date($now, $now));
$recently = strtotime('2024-08-29T11:30:00-07:00');
- $this->assertEquals("30 minutes ago", human_date($recently, $now));
+ $this->assertEquals('30 minutes ago', human_date($recently, $now));
$soon = strtotime('2024-08-29T12:15:00-07:00');
- $this->assertEquals("15 minutes from now", human_date($soon, $now));
+ $this->assertEquals('15 minutes from now', human_date($soon, $now));
$yesterday = strtotime('2024-08-28T09:30:00-07:00');
- $this->assertEquals("1 day ago", human_date($yesterday, $now));
+ $this->assertEquals('1 day ago', human_date($yesterday, $now));
$lastMonth = strtotime('2024-07-28T09:30:00-07:00');
- $this->assertEquals("Jul 28th", human_date($lastMonth, $now));
+ $this->assertEquals('Jul 28th', human_date($lastMonth, $now));
$aFewWeeks = strtotime('2024-08-02T09:30:00-07:00');
- $this->assertEquals("3 weeks ago", human_date($aFewWeeks, $now));
+ $this->assertEquals('3 weeks ago', human_date($aFewWeeks, $now));
$longAgo = strtotime('2023-11-01T09:30:00-07:00');
- $this->assertEquals("Nov 1st", human_date($longAgo, $now));
+ $this->assertEquals('Nov 1st', human_date($longAgo, $now));
$nextMonth = strtotime('2024-09-30T09:30:00-07:00');
- $this->assertEquals("Sep 30th", human_date($nextMonth, $now));
+ $this->assertEquals('Sep 30th', human_date($nextMonth, $now));
$farFuture = strtotime('2026-08-28T09:30:00-07:00');
- $this->assertEquals("Aug 2026", human_date($farFuture, $now));
+ $this->assertEquals('Aug 2026', human_date($farFuture, $now));
// New York time is Gatherling's "home" time.
$differsNewYorkAndLosAngeles = strtotime('2024-06-13T23:30:00-07:00');
- $this->assertEquals("Jun 14th", human_date($differsNewYorkAndLosAngeles, $now));
+ $this->assertEquals('Jun 14th', human_date($differsNewYorkAndLosAngeles, $now));
}
public function testTimeElement()
|
---|
|
---|