Skip to content

Commit

Permalink
refactor: clean up parentheses on assign and ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Oct 30, 2024
1 parent dede747 commit 3f8feaa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ public function transBegin(bool $testMode = false): bool
// Reset the transaction failure flag.
// If the $test_mode flag is set to TRUE transactions will be rolled back
// even if the queries produce a successful result.
$this->transFailure = ($testMode);
$this->transFailure = $testMode;

if ($this->_transBegin()) {
$this->transDepth++;
Expand Down
2 changes: 1 addition & 1 deletion system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function connect(bool $persistent = false)
$port = null;
$socket = $this->hostname;
} else {
$hostname = ($persistent) ? 'p:' . $this->hostname : $this->hostname;
$hostname = $persistent ? 'p:' . $this->hostname : $this->hostname;
$port = empty($this->port) ? null : $this->port;
$socket = '';
}
Expand Down
6 changes: 3 additions & 3 deletions system/Helpers/form_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ function set_select(string $field, string $value = '', bool $default = false): s
}

if ($input === null) {
return ($default) ? ' selected="selected"' : '';
return $default ? ' selected="selected"' : '';
}

if (is_array($input)) {
Expand Down Expand Up @@ -636,7 +636,7 @@ function set_checkbox(string $field, string $value = '', bool $default = false):
return ($input === $value) ? ' checked="checked"' : '';
}

return ($default) ? ' checked="checked"' : '';
return $default ? ' checked="checked"' : '';
}
}

Expand Down Expand Up @@ -673,7 +673,7 @@ function set_radio(string $field, string $value = '', bool $default = false): st
return ((string) $input === $value) ? ' checked="checked"' : '';
}

return ($default) ? ' checked="checked"' : '';
return $default ? ' checked="checked"' : '';
}
}

Expand Down
2 changes: 1 addition & 1 deletion system/Pager/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function getPageURI(?int $page = null, string $group = 'default', bool $r
$uri->setQueryArray($query);
}

return ($returnObject)
return $returnObject
? $uri
: URI::createURIString(
$uri->getScheme(),
Expand Down

0 comments on commit 3f8feaa

Please sign in to comment.