99use Illuminate \Support \Str ;
1010use InvalidArgumentException ;
1111
12- /**
13- * @template TGeometry of Geometry
14- *
15- * @implements ArrayAccess<int, TGeometry>
16- */
1712class GeometryCollection extends Geometry implements ArrayAccess
1813{
19- /** @var Collection<int, TGeometry > */
14+ /** @var Collection<int, Geometry > */
2015 protected Collection $ geometries ;
2116
22- /** @var class-string<TGeometry> */
2317 protected string $ collectionOf = Geometry::class;
2418
2519 protected int $ minimumGeometries = 0 ;
2620
2721 /**
28- * @param Collection<int, TGeometry >|array<int, TGeometry > $geometries
22+ * @param Collection<int, Geometry >|array<int, Geometry > $geometries
2923 *
3024 * @throws InvalidArgumentException
3125 */
@@ -41,12 +35,6 @@ public function __construct(Collection|array $geometries)
4135 $ this ->validateGeometriesCount ();
4236 }
4337
44- /**
45- * @param bool $withFunction
46- * @return string
47- *
48- * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
49- */
5038 public function toWkt (bool $ withFunction = true ): string
5139 {
5240 $ wkt = $ this ->toCollectionWkt (withFunction: true );
@@ -84,7 +72,7 @@ public function toArray(): array
8472 }
8573
8674 /**
87- * @return Collection<int, TGeometry >
75+ * @return Collection<int, Geometry >
8876 */
8977 public function getGeometries (): Collection
9078 {
@@ -102,20 +90,21 @@ public function offsetExists($offset): bool
10290
10391 /**
10492 * @param int $offset
105- * @return TGeometry|null
93+ * @return Geometry
10694 */
107- public function offsetGet ($ offset ): ? Geometry
95+ public function offsetGet ($ offset ): Geometry
10896 {
97+ // @phpstan-ignore-next-line
10998 return $ this ->geometries [$ offset ];
11099 }
111100
112101 /**
113102 * @param int $offset
114- * @param TGeometry $geometry
103+ * @param Geometry $value
115104 */
116- public function offsetSet ($ offset , $ geometry ): void
105+ public function offsetSet ($ offset , $ value ): void
117106 {
118- $ this ->geometries [$ offset ] = $ geometry ;
107+ $ this ->geometries [$ offset ] = $ value ;
119108 $ this ->validateGeometriesType ();
120109 }
121110
0 commit comments