Skip to content

Commit 16e307b

Browse files
committed
1 y 0 en el Caster no castean a bool, son números solamente.
1 parent 9226b78 commit 16e307b

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/Caster.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ private static function isNullLiteral(string $v): bool
122122
private static function parseBool(string $v): ?bool
123123
{
124124
return match (strtolower($v)) {
125-
'true', 'yes', 'on', '1' => true,
126-
'false', 'no', 'off', '0' => false,
127-
default => null,
125+
'true', 'yes', 'on' => true,
126+
'false', 'no', 'off' => false,
127+
default => null,
128128
};
129129
}
130130

tests/src/CasterTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ public static function provideTrueLiteralStrings(): array
118118
'yes uppercase' => ['YES'],
119119
'on lowercase' => ['on'],
120120
'on uppercase' => ['ON'],
121-
'one string' => ['1'],
122121
'true with spaces' => [' true '],
123122
];
124123
}
@@ -140,7 +139,6 @@ public static function provideFalseLiteralStrings(): array
140139
'no uppercase' => ['NO'],
141140
'off lowercase' => ['off'],
142141
'off uppercase' => ['OFF'],
143-
'zero string' => ['0'],
144142
'false with spaces' => [' false '],
145143
];
146144
}

0 commit comments

Comments
 (0)