Skip to content

Commit

Permalink
replace checks that use empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Oct 11, 2023
1 parent 6b23949 commit 7c9c205
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system/Database/Forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ public function processIndexes(string $table): bool
$sqls = [];
$fk = $this->foreignKeys;

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

$fields = $this->fields;

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

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

$this->foreignKeys = $fk;
$this->fields = $fields;

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

Expand Down

0 comments on commit 7c9c205

Please sign in to comment.