Skip to content

Commit ea798c2

Browse files
authored
Make sure we do not convert null => 0 (#696)
1 parent e7ebe5d commit ea798c2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Common/Model/Address.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private static function createCoordinates($latitude, $longitude)
280280
return null;
281281
}
282282

283-
return new Coordinates((float) $latitude, (float) $longitude);
283+
return new Coordinates($latitude, $longitude);
284284
}
285285

286286
/**
@@ -296,7 +296,7 @@ private static function createBounds($south, $west, $north, $east)
296296
return null;
297297
}
298298

299-
return new Bounds((float) $south, (float) $west, (float) $north, (float) $east);
299+
return new Bounds($south, $west, $north, $east);
300300
}
301301

302302
/**

src/Common/Model/Bounds.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ final class Bounds
4747
*/
4848
public function __construct($south, $west, $north, $east)
4949
{
50+
Assert::notNull($south);
51+
Assert::notNull($west);
52+
Assert::notNull($north);
53+
Assert::notNull($east);
54+
5055
$south = (float) $south;
5156
$north = (float) $north;
5257
$west = (float) $west;

0 commit comments

Comments
 (0)