9
9
use Illuminate \Support \Str ;
10
10
use InvalidArgumentException ;
11
11
12
- /**
13
- * @template TGeometry of Geometry
14
- *
15
- * @implements ArrayAccess<int, TGeometry>
16
- */
17
12
class GeometryCollection extends Geometry implements ArrayAccess
18
13
{
19
- /** @var Collection<int, TGeometry > */
14
+ /** @var Collection<int, Geometry > */
20
15
protected Collection $ geometries ;
21
16
22
- /** @var class-string<TGeometry> */
23
17
protected string $ collectionOf = Geometry::class;
24
18
25
19
protected int $ minimumGeometries = 0 ;
26
20
27
21
/**
28
- * @param Collection<int, TGeometry >|array<int, TGeometry > $geometries
22
+ * @param Collection<int, Geometry >|array<int, Geometry > $geometries
29
23
*
30
24
* @throws InvalidArgumentException
31
25
*/
@@ -41,12 +35,6 @@ public function __construct(Collection|array $geometries)
41
35
$ this ->validateGeometriesCount ();
42
36
}
43
37
44
- /**
45
- * @param bool $withFunction
46
- * @return string
47
- *
48
- * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
49
- */
50
38
public function toWkt (bool $ withFunction = true ): string
51
39
{
52
40
$ wkt = $ this ->toCollectionWkt (withFunction: true );
@@ -84,7 +72,7 @@ public function toArray(): array
84
72
}
85
73
86
74
/**
87
- * @return Collection<int, TGeometry >
75
+ * @return Collection<int, Geometry >
88
76
*/
89
77
public function getGeometries (): Collection
90
78
{
@@ -102,20 +90,21 @@ public function offsetExists($offset): bool
102
90
103
91
/**
104
92
* @param int $offset
105
- * @return TGeometry|null
93
+ * @return Geometry
106
94
*/
107
- public function offsetGet ($ offset ): ? Geometry
95
+ public function offsetGet ($ offset ): Geometry
108
96
{
97
+ // @phpstan-ignore-next-line
109
98
return $ this ->geometries [$ offset ];
110
99
}
111
100
112
101
/**
113
102
* @param int $offset
114
- * @param TGeometry $geometry
103
+ * @param Geometry $value
115
104
*/
116
- public function offsetSet ($ offset , $ geometry ): void
105
+ public function offsetSet ($ offset , $ value ): void
117
106
{
118
- $ this ->geometries [$ offset ] = $ geometry ;
107
+ $ this ->geometries [$ offset ] = $ value ;
119
108
$ this ->validateGeometriesType ();
120
109
}
121
110
0 commit comments