Skip to content

Commit

Permalink
Fix static analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinmo committed Nov 12, 2024
1 parent 3801291 commit e4764ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/SimpleJWT/Util/BigNum.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function __construct($str = 0, int $base = 10) {
$this->value = $value;
return;
default:
if (!is_integer($base) || ($base < 2) || ($base > 36))
if (($base < 2) || ($base > 36))
throw new \InvalidArgumentException('$base cannot be less than 2 or greater than 36');

$value = (new BigNum(0))->value;
Expand Down
5 changes: 2 additions & 3 deletions src/SimpleJWT/Util/CBOR/DataItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class DataItem {
* @param int $type the type
* @param mixed $value the native PHP value
* @param int $tag the tag number (i.e. excluding the class and constructed bit masks)
* @throws InvalidArgumentException
*/
function __construct(int $type, $value, int $tag = null) {
$this->type = $type;
Expand Down Expand Up @@ -233,7 +232,7 @@ static public function simple(int $value): self {
* @return DataItem
*/
static public function list(array $value): self {
if (!is_array($value) || !self::array_is_list($value)) {
if (!self::array_is_list($value)) {
throw new InvalidArgumentException('Not an array');
}
return new self(static::LIST_TYPE, $value);
Expand All @@ -246,7 +245,7 @@ static public function list(array $value): self {
* @return DataItem
*/
static public function map(array $value): self {
if (!is_array($value)|| self::array_is_list($value)) {
if (self::array_is_list($value)) {
throw new InvalidArgumentException('Not an associative array');
}
return new self(static::MAP_TYPE, $value);
Expand Down

0 comments on commit e4764ae

Please sign in to comment.