Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary if check #8648

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading