Skip to content

Commit 9b02119

Browse files
zonuexeondrejmirtes
authored andcommitted
Replace with in_array() instead of redundant property
1 parent de2b200 commit 9b02119

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Type/Php/MinMaxFunctionReturnTypeExtension.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,11 @@
1919
use PHPStan\Type\TypeCombinator;
2020
use PHPStan\Type\UnionType;
2121
use function count;
22+
use function in_array;
2223

2324
class MinMaxFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2425
{
2526

26-
/** @var string[] */
27-
private array $functionNames = [
28-
'min' => '',
29-
'max' => '',
30-
];
31-
3227
public function __construct(
3328
private PhpVersion $phpVersion,
3429
)
@@ -37,7 +32,7 @@ public function __construct(
3732

3833
public function isFunctionSupported(FunctionReflection $functionReflection): bool
3934
{
40-
return isset($this->functionNames[$functionReflection->getName()]);
35+
return in_array($functionReflection->getName(), ['min', 'max'], true);
4136
}
4237

4338
public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type

0 commit comments

Comments
 (0)