Skip to content

Commit b62a87c

Browse files
committed
simplify
1 parent 28f1507 commit b62a87c

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/Type/Constant/ConstantArrayType.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
use function count;
6363
use function implode;
6464
use function in_array;
65-
use function is_int;
6665
use function is_string;
6766
use function min;
6867
use function pow;
@@ -755,17 +754,7 @@ private function resolveFiniteScalarKeyTypes(Type $offsetType): ?array
755754
$constantStrings = $offsetType->getConstantStrings();
756755
if (count($constantStrings) > 0) {
757756
foreach ($constantStrings as $constantString) {
758-
$scalarValues = $constantString->getConstantScalarValues();
759-
if (count($scalarValues) !== 1) {
760-
return null;
761-
}
762-
if (is_int($scalarValues[0])) {
763-
$result[] = new ConstantIntegerType($scalarValues[0]);
764-
} elseif (is_string($scalarValues[0])) {
765-
$result[] = new ConstantStringType($scalarValues[0]);
766-
} else {
767-
return null;
768-
}
757+
$result[] = $constantString;
769758
}
770759
} else {
771760
$integerRanges = TypeUtils::getIntegerRanges($offsetType);

0 commit comments

Comments
 (0)