Skip to content

Commit

Permalink
Use isset() && is_int() instead of is_int($array[key] ?? null)
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Jun 20, 2022
1 parent 0473914 commit b98a1cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Type/Php/FilterVarDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ private function getOtherTypes(?Node\Arg $flagsArg, Scope $scope, array $typeOpt
}

if (isset($range['min']) || isset($range['max'])) {
$min = is_int($range['min'] ?? null) ? $range['min'] : null;
$max = is_int($range['max'] ?? null) ? $range['max'] : null;
$min = isset($range['min']) && is_int($range['min']) ? $range['min'] : null;
$max = isset($range['max']) && is_int($range['max']) ? $range['max'] : null;
$otherTypes['range'] = new IntegerRangeType($min, $max);
}

Expand Down

0 comments on commit b98a1cf

Please sign in to comment.