Skip to content

Commit 1ba887c

Browse files
committed
Update ValidLongitude.php
1 parent d1c6075 commit 1ba887c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Rules/ValidLongitude.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ class ValidLongitude implements Rule
1111
*/
1212
public function passes($attribute, $value): bool
1313
{
14-
if (! is_float($value)) {
14+
if (! is_numeric($value)) {
1515
return false;
1616
}
1717

18-
return $value < -180 || $value > 180;
18+
$value = (float) $value;
19+
20+
return $value >= -180 && $value <= 180;
1921
}
2022

2123
/**

0 commit comments

Comments
 (0)