diff --git a/phpstan-baseline.php b/phpstan-baseline.php index da28aa2fb3d5..7dfbce9094a9 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -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, @@ -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, @@ -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, diff --git a/system/HTTP/Negotiate.php b/system/HTTP/Negotiate.php index 9c903908695f..61c3a58f4af7 100644 --- a/system/HTTP/Negotiate.php +++ b/system/HTTP/Negotiate.php @@ -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]; } diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index 97ac2c2a8c5c..098222e90e9f 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -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 . '';