Skip to content

Commit ae0e455

Browse files
authored
Merge pull request #8648 from samsonasik/chore-remove-unnecessary-if-check
chore: remove unnecessary if check
2 parents 7109931 + 0d68bad commit ae0e455

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6766,11 +6766,6 @@
67666766
'count' => 1,
67676767
'path' => __DIR__ . '/system/HTTP/MessageInterface.php',
67686768
];
6769-
$ignoreErrors[] = [
6770-
'message' => '#^Call to function is_array\\(\\) with array will always evaluate to true\\.$#',
6771-
'count' => 1,
6772-
'path' => __DIR__ . '/system/HTTP/Negotiate.php',
6773-
];
67746769
$ignoreErrors[] = [
67756770
'message' => '#^Method CodeIgniter\\\\HTTP\\\\Negotiate\\:\\:charset\\(\\) has parameter \\$supported with no value type specified in iterable type array\\.$#',
67766771
'count' => 1,
@@ -7376,11 +7371,6 @@
73767371
'count' => 1,
73777372
'path' => __DIR__ . '/system/Helpers/filesystem_helper.php',
73787373
];
7379-
$ignoreErrors[] = [
7380-
'message' => '#^Call to function is_array\\(\\) with array will always evaluate to true\\.$#',
7381-
'count' => 1,
7382-
'path' => __DIR__ . '/system/Helpers/form_helper.php',
7383-
];
73847374
$ignoreErrors[] = [
73857375
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
73867376
'count' => 1,
@@ -7571,11 +7561,6 @@
75717561
'count' => 1,
75727562
'path' => __DIR__ . '/system/Helpers/form_helper.php',
75737563
];
7574-
$ignoreErrors[] = [
7575-
'message' => '#^Only booleans are allowed in &&, array given on the right side\\.$#',
7576-
'count' => 1,
7577-
'path' => __DIR__ . '/system/Helpers/form_helper.php',
7578-
];
75797564
$ignoreErrors[] = [
75807565
'message' => '#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#',
75817566
'count' => 1,

system/HTTP/Negotiate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function parseHeader(string $header): array
274274
protected function match(array $acceptable, string $supported, bool $enforceTypes = false, $matchLocales = false): bool
275275
{
276276
$supported = $this->parseHeader($supported);
277-
if (is_array($supported) && count($supported) === 1) {
277+
if (count($supported) === 1) {
278278
$supported = $supported[0];
279279
}
280280

system/Helpers/form_helper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,8 @@ function form_label(string $labelText = '', string $id = '', array $attributes =
456456
$label .= ' for="' . $id . '"';
457457
}
458458

459-
if (is_array($attributes) && $attributes) {
460-
foreach ($attributes as $key => $val) {
461-
$label .= ' ' . $key . '="' . $val . '"';
462-
}
459+
foreach ($attributes as $key => $val) {
460+
$label .= ' ' . $key . '="' . $val . '"';
463461
}
464462

465463
return $label . '>' . $labelText . '</label>';

0 commit comments

Comments
 (0)