|
5 | 5 | use Collection as geoPHPGeometryCollection; |
6 | 6 | use Geometry as geoPHPGeometry; |
7 | 7 | use geoPHP; |
| 8 | +use Illuminate\Support\Collection; |
8 | 9 | use LineString as geoPHPLineString; |
9 | 10 | use MatanYadaev\EloquentSpatial\Objects\Geometry; |
10 | 11 | use MatanYadaev\EloquentSpatial\Objects\GeometryCollection; |
@@ -40,7 +41,7 @@ protected static function create(geoPHPGeometry $geometry): Geometry |
40 | 41 | if ($geometry instanceof geoPHPGeometryCollection) { |
41 | 42 | $components = collect($geometry->components)->map(function (geoPHPGeometry $geometryComponent): Geometry { |
42 | 43 | return self::create($geometryComponent); |
43 | | - })->all(); |
| 44 | + }); |
44 | 45 |
|
45 | 46 | $className = get_class($geometry); |
46 | 47 |
|
@@ -73,55 +74,55 @@ protected static function createPoint(float $latitude, float $longitude): Point |
73 | 74 | } |
74 | 75 |
|
75 | 76 | /** |
76 | | - * @param Point[] $points |
| 77 | + * @param Collection<Point> $points |
77 | 78 | * @return MultiPoint |
78 | 79 | */ |
79 | | - protected static function createMultiPoint(array $points): MultiPoint |
| 80 | + protected static function createMultiPoint(Collection $points): MultiPoint |
80 | 81 | { |
81 | 82 | return new MultiPoint($points); |
82 | 83 | } |
83 | 84 |
|
84 | 85 | /** |
85 | | - * @param Point[] $points |
| 86 | + * @param Collection<Point> $points |
86 | 87 | * @return LineString |
87 | 88 | */ |
88 | | - protected static function createLineString(array $points): LineString |
| 89 | + protected static function createLineString(Collection $points): LineString |
89 | 90 | { |
90 | 91 | return new LineString($points); |
91 | 92 | } |
92 | 93 |
|
93 | 94 | /** |
94 | | - * @param LineString[] $lineStrings |
| 95 | + * @param Collection<LineString> $lineStrings |
95 | 96 | * @return Polygon |
96 | 97 | */ |
97 | | - protected static function createPolygon(array $lineStrings): Polygon |
| 98 | + protected static function createPolygon(Collection $lineStrings): Polygon |
98 | 99 | { |
99 | 100 | return new Polygon($lineStrings); |
100 | 101 | } |
101 | 102 |
|
102 | 103 | /** |
103 | | - * @param LineString[] $lineStrings |
| 104 | + * @param Collection<LineString> $lineStrings |
104 | 105 | * @return MultiLineString |
105 | 106 | */ |
106 | | - protected static function createMultiLineString(array $lineStrings):MultiLineString |
| 107 | + protected static function createMultiLineString(Collection $lineStrings):MultiLineString |
107 | 108 | { |
108 | 109 | return new MultiLineString($lineStrings); |
109 | 110 | } |
110 | 111 |
|
111 | 112 | /** |
112 | | - * @param Polygon[] $polygons |
| 113 | + * @param Collection<Polygon> $polygons |
113 | 114 | * @return MultiPolygon |
114 | 115 | */ |
115 | | - protected static function createMultiPolygon(array $polygons): MultiPolygon |
| 116 | + protected static function createMultiPolygon(Collection $polygons): MultiPolygon |
116 | 117 | { |
117 | 118 | return new MultiPolygon($polygons); |
118 | 119 | } |
119 | 120 |
|
120 | 121 | /** |
121 | | - * @param Geometry[] $geometries |
| 122 | + * @param Collection<Geometry> $geometries |
122 | 123 | * @return GeometryCollection |
123 | 124 | */ |
124 | | - protected static function createGeometryCollection(array $geometries): GeometryCollection |
| 125 | + protected static function createGeometryCollection(Collection $geometries): GeometryCollection |
125 | 126 | { |
126 | 127 | return new GeometryCollection($geometries); |
127 | 128 | } |
|
0 commit comments