1616 * This class provides a common interface used by many other
1717 * classes in a Slim application that manage "collections"
1818 * of data that must be inspected and/or manipulated
19+ *
20+ * @phpstan-consistent-constructor
1921 */
2022class Collection implements CollectionInterface
2123{
@@ -109,6 +111,7 @@ public function clear()
109111 *
110112 * @return bool
111113 */
114+ #[\ReturnTypeWillChange]
112115 public function offsetExists ($ key )
113116 {
114117 return $ this ->has ($ key );
@@ -121,6 +124,7 @@ public function offsetExists($key)
121124 *
122125 * @return mixed The key's value, or the default value
123126 */
127+ #[\ReturnTypeWillChange]
124128 public function offsetGet ($ key )
125129 {
126130 return $ this ->get ($ key );
@@ -132,6 +136,7 @@ public function offsetGet($key)
132136 * @param string $key The data key
133137 * @param mixed $value The data value
134138 */
139+ #[\ReturnTypeWillChange]
135140 public function offsetSet ($ key , $ value )
136141 {
137142 $ this ->set ($ key , $ value );
@@ -142,6 +147,7 @@ public function offsetSet($key, $value)
142147 *
143148 * @param string $key The data key
144149 */
150+ #[\ReturnTypeWillChange]
145151 public function offsetUnset ($ key )
146152 {
147153 $ this ->remove ($ key );
@@ -152,6 +158,7 @@ public function offsetUnset($key)
152158 *
153159 * @return int
154160 */
161+ #[\ReturnTypeWillChange]
155162 public function count ()
156163 {
157164 return count ($ this ->data );
@@ -162,6 +169,7 @@ public function count()
162169 *
163170 * @return ArrayIterator
164171 */
172+ #[\ReturnTypeWillChange]
165173 public function getIterator ()
166174 {
167175 return new ArrayIterator ($ this ->data );
0 commit comments