Skip to content

Commit

Permalink
refactor: clean up parentheses on ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Oct 30, 2024
1 parent dede747 commit 5aaecd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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 5aaecd6

Please sign in to comment.