1111use Illuminate \Contracts \Support \Arrayable ;
1212use InvalidArgumentException ;
1313use IteratorAggregate ;
14+ use Traversable ;
1415
1516class GeometryCollection extends Geometry implements IteratorAggregate, ArrayAccess, Arrayable, Countable
1617{
@@ -87,22 +88,22 @@ public function toArray()
8788 return $ this ->items ;
8889 }
8990
90- public function getIterator ()
91+ public function getIterator (): Traversable
9192 {
9293 return new ArrayIterator ($ this ->items );
9394 }
9495
95- public function offsetExists ($ offset )
96+ public function offsetExists ($ offset ): bool
9697 {
9798 return isset ($ this ->items [$ offset ]);
9899 }
99100
100- public function offsetGet ($ offset )
101+ public function offsetGet ($ offset ): mixed
101102 {
102103 return $ this ->offsetExists ($ offset ) ? $ this ->items [$ offset ] : null ;
103104 }
104105
105- public function offsetSet ($ offset , $ value )
106+ public function offsetSet ($ offset , $ value ): void
106107 {
107108 $ this ->validateItemType ($ value );
108109
@@ -113,12 +114,12 @@ public function offsetSet($offset, $value)
113114 }
114115 }
115116
116- public function offsetUnset ($ offset )
117+ public function offsetUnset ($ offset ): void
117118 {
118119 unset($ this ->items [$ offset ]);
119120 }
120121
121- public function count ()
122+ public function count (): int
122123 {
123124 return count ($ this ->items );
124125 }
@@ -146,7 +147,7 @@ public static function fromJson($geoJson)
146147 *
147148 * @return \GeoJson\Geometry\GeometryCollection
148149 */
149- public function jsonSerialize ()
150+ public function jsonSerialize (): mixed
150151 {
151152 $ geometries = [];
152153 foreach ($ this ->items as $ geometry ) {
0 commit comments