Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 702d59e

Browse files
committed
fix: do not allow numeric values to be compared with string values
1 parent cd6ba3e commit 702d59e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Rule/GreaterThan.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ protected function canBeCompared(mixed $constraint, mixed $value): bool
4646
return true;
4747
}
4848

49-
if (is_scalar($constraint) && is_scalar($value)) {
49+
if (\is_numeric($constraint) && \is_numeric($value)) {
50+
return true;
51+
}
52+
53+
if (\is_string($constraint) && \is_string($value)) {
5054
return true;
5155
}
5256

0 commit comments

Comments
 (0)