Skip to content

Commit 53a6df0

Browse files
committed
Use more explicit check for empty polygon
1 parent f5c7650 commit 53a6df0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Polygon.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(array $points = array())
1515

1616
public function isClosed()
1717
{
18-
if (!$this->points) {
18+
if (0 === count($this->points)) {
1919
return false;
2020
}
2121

@@ -30,7 +30,7 @@ public function isClosed()
3030

3131
public function close()
3232
{
33-
if (!$this->points) {
33+
if (0 === count($this->points)) {
3434
return new self();
3535
}
3636

@@ -50,7 +50,7 @@ public function close()
5050
*/
5151
public function contains(LatLng $latLng)
5252
{
53-
if (!$this->points) {
53+
if (0 === count($this->points)) {
5454
return false;
5555
}
5656

@@ -86,7 +86,7 @@ public function contains(LatLng $latLng)
8686

8787
public function toBounds()
8888
{
89-
if (!$this->points) {
89+
if (0 === count($this->points)) {
9090
throw new \LogicException('Cannot create Bounds from empty Polygon.');
9191
}
9292

0 commit comments

Comments
 (0)