Skip to content

Commit c8e4ed9

Browse files
committed
Stop using TypeUtils in InArrayFunctionTypeSpecifyingExtension
1 parent 6e263d0 commit c8e4ed9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Type/Php/InArrayFunctionTypeSpecifyingExtension.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use PHPStan\Type\FunctionTypeSpecifyingExtension;
1919
use PHPStan\Type\MixedType;
2020
use PHPStan\Type\TypeCombinator;
21-
use PHPStan\Type\TypeUtils;
2221
use function count;
2322
use function strtolower;
2423

@@ -111,10 +110,7 @@ public function specifyTypes(FunctionReflection $functionReflection, FuncCall $n
111110
$context->true()
112111
|| (
113112
$context->false()
114-
&& (
115-
count(TypeUtils::getConstantScalars($arrayValueType)) > 0
116-
|| count(TypeUtils::getEnumCaseObjects($arrayValueType)) > 0
117-
)
113+
&& count($arrayValueType->getFiniteTypes()) === 1
118114
)
119115
) {
120116
$specifiedTypes = $this->typeSpecifier->create(
@@ -137,10 +133,7 @@ public function specifyTypes(FunctionReflection $functionReflection, FuncCall $n
137133
$context->true()
138134
|| (
139135
$context->false()
140-
&& (
141-
count(TypeUtils::getConstantScalars($needleType)) === 1
142-
|| count(TypeUtils::getEnumCaseObjects($needleType)) === 1
143-
)
136+
&& count($needleType->getFiniteTypes()) === 1
144137
)
145138
) {
146139
if ($context->true()) {

0 commit comments

Comments
 (0)