From b132a7d2f7c2a6180ea0cedec54d9ee287f51517 Mon Sep 17 00:00:00 2001 From: mambax7 Date: Mon, 30 Oct 2023 12:13:16 -0400 Subject: [PATCH] Redundant 'else' keyword --- src/FilterInput.php | 5 +++-- src/Jwt/JsonWebToken.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/FilterInput.php b/src/FilterInput.php index dbc219d..0931a25 100644 --- a/src/FilterInput.php +++ b/src/FilterInput.php @@ -146,7 +146,7 @@ public static function getInstance( * * @param mixed $source - input string/array-of-string to be 'cleaned' * - * @return string $source - 'cleaned' version of input parameter + * @return string|array $source - 'cleaned' version of input parameter */ public function process($source) { @@ -159,7 +159,8 @@ public function process($source) } } return $source; - } elseif (is_string($source)) { + } + if (is_string($source)) { // clean this string return $this->remove($this->decode($source)); } else { diff --git a/src/Jwt/JsonWebToken.php b/src/Jwt/JsonWebToken.php index f062a7b..2947b55 100644 --- a/src/Jwt/JsonWebToken.php +++ b/src/Jwt/JsonWebToken.php @@ -90,7 +90,9 @@ public function decode($jwtString, $assertClaims = array()) foreach ($assertClaims as $claim => $assert) { if (!property_exists($values, $claim)) { return false; - } elseif ($values->$claim != $assert) { + } + + if ($values->$claim != $assert) { return false; } }