Skip to content

Commit 7eea620

Browse files
authored
Merge pull request #80 from iggyvolz/more-return-type-will-change
Add more ReturnTypeWillChange annotations
2 parents 399aa03 + 6800c90 commit 7eea620

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
@@ -371,6 +371,7 @@ public function clear()
371371
/**
372372
* @inheritdoc
373373
*/
374+
#[\ReturnTypeWillChange]
374375
public function offsetSet($offset, $value)
375376
{
376377
if ($offset === null) {
@@ -383,6 +384,7 @@ public function offsetSet($offset, $value)
383384
/**
384385
* @inheritdoc
385386
*/
387+
#[\ReturnTypeWillChange]
386388
public function &offsetGet($offset)
387389
{
388390
if ( ! $this->validIndex($offset)) {
@@ -395,6 +397,7 @@ public function &offsetGet($offset)
395397
/**
396398
* @inheritdoc
397399
*/
400+
#[\ReturnTypeWillChange]
398401
public function offsetUnset($offset)
399402
{
400403
if (is_integer($offset) && $this->validIndex($offset)) {
@@ -405,6 +408,7 @@ public function offsetUnset($offset)
405408
/**
406409
* @inheritdoc
407410
*/
411+
#[\ReturnTypeWillChange]
408412
public function offsetExists($offset)
409413
{
410414
return is_integer($offset)

0 commit comments

Comments
 (0)