Skip to content

Commit 384f012

Browse files
committed
Fixed exception messages. Removed useless return when creating multipoint.
1 parent bb9ded4 commit 384f012

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

src/Types/MultiLineString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(array $linestrings)
2626
});
2727

2828
if (count($linestrings) !== count($validated)) {
29-
throw new InvalidArgumentException('$linestrings must be an array of Points');
29+
throw new InvalidArgumentException('$linestrings must be an array of LineString');
3030
}
3131

3232
$this->linestrings = $linestrings;

src/Types/MultiPoint.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public static function fromString($wktArgument)
2121
$matches = [];
2222
preg_match_all('/\(\s*(\d+\s+\d+)\s*\)/', trim($wktArgument), $matches);
2323

24-
if (count($matches) < 2) {
25-
return new static([]);
26-
}
27-
2824
$points = array_map(function ($pair) {
2925
return Point::fromPair($pair);
3026
}, $matches[1]);

src/Types/MultiPolygon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(array $polygons)
2222
});
2323

2424
if (count($polygons) !== count($validated)) {
25-
throw new InvalidArgumentException('$polygons must be an array of Points');
25+
throw new InvalidArgumentException('$polygons must be an array of Polygon');
2626
}
2727
$this->polygons = $polygons;
2828
}

0 commit comments

Comments
 (0)