Skip to content

Commit 6800c90

Browse files
committed
Add more ReturnTypeWillChange annotations
1 parent dd55a2b commit 6800c90

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

src/Map.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ public function xor(Map $map): Map
734734
/**
735735
* @inheritDoc
736736
*/
737+
#[\ReturnTypeWillChange]
737738
public function getIterator()
738739
{
739740
foreach ($this->pairs as $pair) {
@@ -754,6 +755,7 @@ public function __debugInfo()
754755
/**
755756
* @inheritdoc
756757
*/
758+
#[\ReturnTypeWillChange]
757759
public function offsetSet($offset, $value)
758760
{
759761
$this->put($offset, $value);
@@ -764,6 +766,7 @@ public function offsetSet($offset, $value)
764766
*
765767
* @throws OutOfBoundsException
766768
*/
769+
#[\ReturnTypeWillChange]
767770
public function &offsetGet($offset)
768771
{
769772
$pair = $this->lookupKey($offset);
@@ -777,6 +780,7 @@ public function &offsetGet($offset)
777780
/**
778781
* @inheritdoc
779782
*/
783+
#[\ReturnTypeWillChange]
780784
public function offsetUnset($offset)
781785
{
782786
$this->remove($offset, null);
@@ -785,6 +789,7 @@ public function offsetUnset($offset)
785789
/**
786790
* @inheritdoc
787791
*/
792+
#[\ReturnTypeWillChange]
788793
public function offsetExists($offset)
789794
{
790795
return $this->get($offset, null) !== null;

src/Queue.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public function getIterator()
141141
*
142142
* @throws OutOfBoundsException
143143
*/
144+
#[\ReturnTypeWillChange]
144145
public function offsetSet($offset, $value)
145146
{
146147
if ($offset === null) {
@@ -155,6 +156,7 @@ public function offsetSet($offset, $value)
155156
*
156157
* @throws Error
157158
*/
159+
#[\ReturnTypeWillChange]
158160
public function offsetGet($offset)
159161
{
160162
throw new Error();
@@ -165,6 +167,7 @@ public function offsetGet($offset)
165167
*
166168
* @throws Error
167169
*/
170+
#[\ReturnTypeWillChange]
168171
public function offsetUnset($offset)
169172
{
170173
throw new Error();

src/Set.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ public function union(Set $set): Set
458458
/**
459459
* Get iterator
460460
*/
461+
#[\ReturnTypeWillChange]
461462
public function getIterator()
462463
{
463464
foreach ($this->table as $key => $value) {
@@ -470,6 +471,7 @@ public function getIterator()
470471
*
471472
* @throws OutOfBoundsException
472473
*/
474+
#[\ReturnTypeWillChange]
473475
public function offsetSet($offset, $value)
474476
{
475477
if ($offset === null) {
@@ -482,6 +484,7 @@ public function offsetSet($offset, $value)
482484
/**
483485
* @inheritdoc
484486
*/
487+
#[\ReturnTypeWillChange]
485488
public function offsetGet($offset)
486489
{
487490
return $this->table->skip($offset)->key;
@@ -492,6 +495,7 @@ public function offsetGet($offset)
492495
*
493496
* @throws Error
494497
*/
498+
#[\ReturnTypeWillChange]
495499
public function offsetExists($offset)
496500
{
497501
throw new Error();
@@ -502,6 +506,7 @@ public function offsetExists($offset)
502506
*
503507
* @throws Error
504508
*/
509+
#[\ReturnTypeWillChange]
505510
public function offsetUnset($offset)
506511
{
507512
throw new Error();

src/Stack.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public function getIterator()
144144
*
145145
* @throws OutOfBoundsException
146146
*/
147+
#[\ReturnTypeWillChange]
147148
public function offsetSet($offset, $value)
148149
{
149150
if ($offset === null) {
@@ -158,6 +159,7 @@ public function offsetSet($offset, $value)
158159
*
159160
* @throws Error
160161
*/
162+
#[\ReturnTypeWillChange]
161163
public function offsetGet($offset)
162164
{
163165
throw new Error();
@@ -168,6 +170,7 @@ public function offsetGet($offset)
168170
*
169171
* @throws Error
170172
*/
173+
#[\ReturnTypeWillChange]
171174
public function offsetUnset($offset)
172175
{
173176
throw new Error();
@@ -178,6 +181,7 @@ public function offsetUnset($offset)
178181
*
179182
* @throws Error
180183
*/
184+
#[\ReturnTypeWillChange]
181185
public function offsetExists($offset)
182186
{
183187
throw new Error();

src/Traits/GenericSequence.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ public function clear()
364364
/**
365365
* @inheritdoc
366366
*/
367+
#[\ReturnTypeWillChange]
367368
public function offsetSet($offset, $value)
368369
{
369370
if ($offset === null) {
@@ -376,6 +377,7 @@ public function offsetSet($offset, $value)
376377
/**
377378
* @inheritdoc
378379
*/
380+
#[\ReturnTypeWillChange]
379381
public function &offsetGet($offset)
380382
{
381383
if ( ! $this->validIndex($offset)) {
@@ -388,6 +390,7 @@ public function &offsetGet($offset)
388390
/**
389391
* @inheritdoc
390392
*/
393+
#[\ReturnTypeWillChange]
391394
public function offsetUnset($offset)
392395
{
393396
if (is_integer($offset) && $this->validIndex($offset)) {
@@ -398,6 +401,7 @@ public function offsetUnset($offset)
398401
/**
399402
* @inheritdoc
400403
*/
404+
#[\ReturnTypeWillChange]
401405
public function offsetExists($offset)
402406
{
403407
return is_integer($offset)

0 commit comments

Comments
 (0)