#9293 - incompatible return type php 8.1 (#9301)

* #9293 - fix Missing function's return type declaration (incompatible return type php 8.1)

* #9293 - remove return type void for compatible with php 7.0

* #9293 - add todo for mixed return type

Co-authored-by: Adam Cozzette <acozzette@google.com>
pull/9497/head
Oleg Kolesov 3 years ago committed by GitHub
parent 2ce9604227
commit fe87de31bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      php/src/Google/Protobuf/Internal/MapField.php
  2. 4
      php/src/Google/Protobuf/Internal/MapFieldIter.php
  3. 3
      php/src/Google/Protobuf/Internal/RepeatedField.php
  4. 4
      php/src/Google/Protobuf/Internal/RepeatedFieldIter.php

@ -135,6 +135,7 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
* @return object The stored element at given key.
* @throws \ErrorException Invalid type for index.
* @throws \ErrorException Non-existing index.
* @todo need to add return type mixed (require update php version to 8.0)
*/
#[\ReturnTypeWillChange]
public function offsetGet($key)
@ -153,6 +154,7 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
* @throws \ErrorException Invalid type for key.
* @throws \ErrorException Invalid type for value.
* @throws \ErrorException Non-existing key.
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function offsetSet($key, $value)
@ -212,6 +214,7 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
* @param object $key The key of the element to be removed.
* @return void
* @throws \ErrorException Invalid type for key.
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function offsetUnset($key)

@ -67,6 +67,7 @@ class MapFieldIter implements \Iterator
* Reset the status of the iterator
*
* @return void
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function rewind()
@ -78,6 +79,7 @@ class MapFieldIter implements \Iterator
* Return the element at the current position.
*
* @return object The element at the current position.
* @todo need to add return type mixed (require update php version to 8.0)
*/
#[\ReturnTypeWillChange]
public function current()
@ -89,6 +91,7 @@ class MapFieldIter implements \Iterator
* Return the current key.
*
* @return object The current key.
* @todo need to add return type mixed (require update php version to 8.0)
*/
#[\ReturnTypeWillChange]
public function key()
@ -119,6 +122,7 @@ class MapFieldIter implements \Iterator
* Move to the next position.
*
* @return void
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function next()

@ -121,6 +121,7 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
* @return object The stored element at given index.
* @throws \ErrorException Invalid type for index.
* @throws \ErrorException Non-existing index.
* @todo need to add return type mixed (require update php version to 8.0)
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
@ -139,6 +140,7 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
* @throws \ErrorException Invalid type for index.
* @throws \ErrorException Non-existing index.
* @throws \ErrorException Incorrect type of the element.
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
@ -211,6 +213,7 @@ class RepeatedField implements \ArrayAccess, \IteratorAggregate, \Countable
* @throws \ErrorException Invalid type for index.
* @throws \ErrorException The element to be removed is not at the end of the
* RepeatedField.
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)

@ -70,6 +70,7 @@ class RepeatedFieldIter implements \Iterator
* Reset the status of the iterator
*
* @return void
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function rewind()
@ -81,6 +82,7 @@ class RepeatedFieldIter implements \Iterator
* Return the element at the current position.
*
* @return object The element at the current position.
* @todo need to add return type mixed (require update php version to 8.0)
*/
#[\ReturnTypeWillChange]
public function current()
@ -92,6 +94,7 @@ class RepeatedFieldIter implements \Iterator
* Return the current position.
*
* @return integer The current position.
* @todo need to add return type mixed (require update php version to 8.0)
*/
#[\ReturnTypeWillChange]
public function key()
@ -103,6 +106,7 @@ class RepeatedFieldIter implements \Iterator
* Move to the next position.
*
* @return void
* @todo need to add return type void (require update php version to 7.1)
*/
#[\ReturnTypeWillChange]
public function next()

Loading…
Cancel
Save