From 23624c0de2922a30ceadbb63a6d3eed880fbef7b Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 8 Nov 2023 15:45:20 +0900 Subject: [PATCH 1/2] refactor: fix param types --- system/CLI/CLI.php | 2 +- system/Commands/Database/MigrateStatus.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php index c6bcb3557590..e2aa363e5851 100644 --- a/system/CLI/CLI.php +++ b/system/CLI/CLI.php @@ -256,7 +256,7 @@ public static function prompt(string $field, $options = null, $validation = null static::fwrite(STDOUT, $field . (trim($field) ? ' ' : '') . $extraOutput . ': '); // Read the input from keyboard. - $input = trim(static::$io->input()) ?: $default; + $input = trim(static::$io->input()) ?: (string) $default; if ($validation !== []) { while (! static::validate('"' . trim($field) . '"', $input, $validation)) { diff --git a/system/Commands/Database/MigrateStatus.php b/system/Commands/Database/MigrateStatus.php index cc7fe7d1ef02..0ef078080247 100644 --- a/system/Commands/Database/MigrateStatus.php +++ b/system/Commands/Database/MigrateStatus.php @@ -127,7 +127,7 @@ public function run(array $params) continue; } - $date = date('Y-m-d H:i:s', $row->time); + $date = date('Y-m-d H:i:s', (int) $row->time); $group = $row->group; $batch = $row->batch; // @codeCoverageIgnoreEnd From c91de9834a30d0eb22fbdffa642979e7f22657cf Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 8 Nov 2023 15:45:45 +0900 Subject: [PATCH 2/2] test: fix param type --- tests/system/Models/InsertModelTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/Models/InsertModelTest.php b/tests/system/Models/InsertModelTest.php index f538b417c935..2d6775c97ff8 100644 --- a/tests/system/Models/InsertModelTest.php +++ b/tests/system/Models/InsertModelTest.php @@ -120,7 +120,7 @@ public function testInsertBatchSetsIntTimestamps(): void $this->assertSame(2, $this->model->insertBatch($jobData)); $result = $this->model->where('name', 'Philosopher')->first(); - $this->assertCloseEnough(time(), $result->created_at); + $this->assertCloseEnough(time(), (int) $result->created_at); } public function testInsertBatchSetsDatetimeTimestamps(): void