Skip to content

Commit 3da8941

Browse files
committed
Fix
1 parent 3012e24 commit 3da8941

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Type/ClassStringType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function isString(): TrinaryLogic
4646

4747
public function isNumericString(): TrinaryLogic
4848
{
49-
return TrinaryLogic::createMaybe();
49+
return TrinaryLogic::createNo();
5050
}
5151

5252
public function isDecimalIntegerString(): TrinaryLogic

src/Type/StringType.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ public function toArrayKey(): Type
184184
return $this;
185185
}
186186

187+
$isDecimalIntString = $this->isDecimalIntegerString();
188+
if ($isDecimalIntString->no()) {
189+
return $this;
190+
} elseif ($isDecimalIntString->yes()) {
191+
return new IntegerType();
192+
}
193+
187194
return new UnionType([
188195
new IntegerType(),
189196
TypeCombinator::intersect($this, new AccessoryDecimalIntegerStringType(inverse: true)),

0 commit comments

Comments
 (0)