Skip to content

Commit 3f8feaa

Browse files
committed
refactor: clean up parentheses on assign and ternary
1 parent dede747 commit 3f8feaa

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

system/Database/BaseConnection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ public function transBegin(bool $testMode = false): bool
848848
// Reset the transaction failure flag.
849849
// If the $test_mode flag is set to TRUE transactions will be rolled back
850850
// even if the queries produce a successful result.
851-
$this->transFailure = ($testMode);
851+
$this->transFailure = $testMode;
852852

853853
if ($this->_transBegin()) {
854854
$this->transDepth++;

system/Database/MySQLi/Connection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function connect(bool $persistent = false)
9696
$port = null;
9797
$socket = $this->hostname;
9898
} else {
99-
$hostname = ($persistent) ? 'p:' . $this->hostname : $this->hostname;
99+
$hostname = $persistent ? 'p:' . $this->hostname : $this->hostname;
100100
$port = empty($this->port) ? null : $this->port;
101101
$socket = '';
102102
}

system/Helpers/form_helper.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ function set_select(string $field, string $value = '', bool $default = false): s
582582
}
583583

584584
if ($input === null) {
585-
return ($default) ? ' selected="selected"' : '';
585+
return $default ? ' selected="selected"' : '';
586586
}
587587

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

639-
return ($default) ? ' checked="checked"' : '';
639+
return $default ? ' checked="checked"' : '';
640640
}
641641
}
642642

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

676-
return ($default) ? ' checked="checked"' : '';
676+
return $default ? ' checked="checked"' : '';
677677
}
678678
}
679679

system/Pager/Pager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public function getPageURI(?int $page = null, string $group = 'default', bool $r
288288
$uri->setQueryArray($query);
289289
}
290290

291-
return ($returnObject)
291+
return $returnObject
292292
? $uri
293293
: URI::createURIString(
294294
$uri->getScheme(),

0 commit comments

Comments
 (0)