Skip to content

Commit

Permalink
Minor bugfixes up
Browse files Browse the repository at this point in the history
  • Loading branch information
huntervk committed Feb 4, 2024
1 parent 204fce9 commit be732f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Types/NonEmptyStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
throw new CastException($value, $this);
}
$stringValue = (string) $value;
if (empty($stringValue)) {
if ($stringValue === '') {
throw new CastException($value, $this);
}
return $stringValue;
Expand Down
5 changes: 5 additions & 0 deletions tests/Types/ArrayKeyTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ protected function type(): Type
return _array_key();
}

protected function strictCastResultComparison(): bool
{
return false;
}

protected function baselineCast(mixed $value): int|string|null
{
try {
Expand Down

0 comments on commit be732f0

Please sign in to comment.