Skip to content

Commit 52ba574

Browse files
committed
Merge remote-tracking branch 'origin/issue-95-point-collection-min-items' into issue-95-point-collection-min-items
2 parents 7d0e7f2 + 5f72bd1 commit 52ba574

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/Types/GeometryCollection.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,27 +150,32 @@ public function jsonSerialize()
150150
}
151151

152152
/**
153-
* Checks
153+
* Checks.
154+
*
154155
* @param array $items
155156
*/
156-
protected function validateItems(array $items) {
157+
protected function validateItems(array $items)
158+
{
157159
$this->validateItemCount($items);
158160

159161
foreach ($items as $item) {
160162
$this->validateItemType($item);
161163
}
162164
}
163165

164-
protected function validateItemCount(array $items) {
166+
protected function validateItemCount(array $items)
167+
{
165168
if (count($items) < $this->minimumCollectionItems) {
166169
$entries = $this->minimumCollectionItems === 1 ? 'entry' : 'entries';
170+
167171
throw new InvalidArgumentException(sprintf(
168172
'%s must contain at least %d %s', get_class($this), $this->minimumCollectionItems, $entries
169173
));
170174
}
171175
}
172176

173-
protected function validateItemType($item) {
177+
protected function validateItemType($item)
178+
{
174179
if (!$item instanceof $this->collectionItemType) {
175180
throw new InvalidArgumentException(sprintf(
176181
'%s must be a collection of %s', get_class($this), $this->collectionItemType

src/Types/MultiLineString.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use GeoJson\GeoJson;
66
use GeoJson\Geometry\MultiLineString as GeoJsonMultiLineString;
77
use Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException;
8-
use InvalidArgumentException;
98

109
class MultiLineString extends GeometryCollection
1110
{

src/Types/MultiPolygon.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use GeoJson\GeoJson;
66
use GeoJson\Geometry\MultiPolygon as GeoJsonMultiPolygon;
77
use Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException;
8-
use InvalidArgumentException;
98

109
class MultiPolygon extends GeometryCollection
1110
{

0 commit comments

Comments
 (0)