Skip to content

Commit 7c9c205

Browse files
committed
replace checks that use empty()
1 parent 6b23949 commit 7c9c205

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

system/Database/Forge.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ public function processIndexes(string $table): bool
10731073
$sqls = [];
10741074
$fk = $this->foreignKeys;
10751075

1076-
if (empty($this->fields)) {
1076+
if ($this->fields === []) {
10771077
$this->fields = array_flip(array_map(
10781078
static fn ($columnName) => $columnName->name,
10791079
$this->db->getFieldData($this->db->DBPrefix . $table)
@@ -1082,18 +1082,18 @@ public function processIndexes(string $table): bool
10821082

10831083
$fields = $this->fields;
10841084

1085-
if (! empty($this->keys)) {
1085+
if ($this->keys !== []) {
10861086
$sqls = $this->_processIndexes($this->db->DBPrefix . $table, true);
10871087
}
10881088

1089-
if (! empty($this->primaryKeys)) {
1089+
if ($this->primaryKeys !== []) {
10901090
$sqls[] = $this->_processPrimaryKeys($table, true);
10911091
}
10921092

10931093
$this->foreignKeys = $fk;
10941094
$this->fields = $fields;
10951095

1096-
if (! empty($this->foreignKeys)) {
1096+
if ($this->foreignKeys !== []) {
10971097
$sqls = array_merge($sqls, $this->_processForeignKeys($table, true));
10981098
}
10991099

0 commit comments

Comments
 (0)