Skip to content

Commit

Permalink
Merge pull request #9267 from samsonasik/use-compare-empty-array
Browse files Browse the repository at this point in the history
refactor: use compare empty array on Forge on keys property
  • Loading branch information
samsonasik authored Nov 12, 2024
2 parents a9fa3d0 + c8b3804 commit 1e9483c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,7 @@
$ignoreErrors[] = [
// identifier: empty.notAllowed
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
'count' => 13,
'count' => 12,
'path' => __DIR__ . '/system/Database/Forge.php',
];
$ignoreErrors[] = [
Expand Down
2 changes: 1 addition & 1 deletion system/Database/Forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ public function createTable(string $table, bool $ifNotExists = false, array $att
}

// Most databases don't support creating indexes from within the CREATE TABLE statement
if (! empty($this->keys)) {
if ($this->keys !== []) {
for ($i = 0, $sqls = $this->_processIndexes($table), $c = count($sqls); $i < $c; $i++) {
$this->db->query($sqls[$i]);
}
Expand Down

0 comments on commit 1e9483c

Please sign in to comment.