Skip to content

Commit

Permalink
Merge pull request #8648 from samsonasik/chore-remove-unnecessary-if-…
Browse files Browse the repository at this point in the history
…check

chore: remove unnecessary if check
  • Loading branch information
kenjis authored Mar 22, 2024
2 parents 7109931 + 0d68bad commit ae0e455
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
15 changes: 0 additions & 15 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -6766,11 +6766,6 @@
'count' => 1,
'path' => __DIR__ . '/system/HTTP/MessageInterface.php',
];
$ignoreErrors[] = [
'message' => '#^Call to function is_array\\(\\) with array will always evaluate to true\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/HTTP/Negotiate.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\Negotiate\\:\\:charset\\(\\) has parameter \\$supported with no value type specified in iterable type array\\.$#',
'count' => 1,
Expand Down Expand Up @@ -7376,11 +7371,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Helpers/filesystem_helper.php',
];
$ignoreErrors[] = [
'message' => '#^Call to function is_array\\(\\) with array will always evaluate to true\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Helpers/form_helper.php',
];
$ignoreErrors[] = [
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
'count' => 1,
Expand Down Expand Up @@ -7571,11 +7561,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Helpers/form_helper.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in &&, array given on the right side\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Helpers/form_helper.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#',
'count' => 1,
Expand Down
2 changes: 1 addition & 1 deletion system/HTTP/Negotiate.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function parseHeader(string $header): array
protected function match(array $acceptable, string $supported, bool $enforceTypes = false, $matchLocales = false): bool
{
$supported = $this->parseHeader($supported);
if (is_array($supported) && count($supported) === 1) {
if (count($supported) === 1) {
$supported = $supported[0];
}

Expand Down
6 changes: 2 additions & 4 deletions system/Helpers/form_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,8 @@ function form_label(string $labelText = '', string $id = '', array $attributes =
$label .= ' for="' . $id . '"';
}

if (is_array($attributes) && $attributes) {
foreach ($attributes as $key => $val) {
$label .= ' ' . $key . '="' . $val . '"';
}
foreach ($attributes as $key => $val) {
$label .= ' ' . $key . '="' . $val . '"';
}

return $label . '>' . $labelText . '</label>';
Expand Down

0 comments on commit ae0e455

Please sign in to comment.