Skip to content

Commit

Permalink
Merge pull request #8175 from kenjis/refactor-param-types
Browse files Browse the repository at this point in the history
refactor: fix param types
  • Loading branch information
kenjis authored Nov 20, 2023
2 parents c4dba01 + c91de98 commit 0153a66
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion system/CLI/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion system/Commands/Database/MigrateStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Models/InsertModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0153a66

Please sign in to comment.