From 5e3f825dcad0a13fc7f77484afb61691d5e53bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Sat, 11 Sep 2021 22:45:27 +0200 Subject: [PATCH] EnumIsValidRule : fix int casting --- src/Rules/EnumIsValidRule.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Rules/EnumIsValidRule.php b/src/Rules/EnumIsValidRule.php index ab87494..77d9ad7 100644 --- a/src/Rules/EnumIsValidRule.php +++ b/src/Rules/EnumIsValidRule.php @@ -22,7 +22,8 @@ class EnumIsValidRule extends BaseEnumRule { try { // try cast to int if is int - $value = is_numeric($value) && floatval(intval($value)) === floatval($value) ? (int)$value : $value; + $value = (is_numeric($value) and floatval(intval($value)) === floatval($value)) ? + (int)$value : $value; forward_static_call([$this->enumClass, 'make'], $value); } catch (TypeError $e) { $this->messageType = 1;