Skip to content

Commit

Permalink
protocolbuffers#9293 - add todo for mixed return type
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg1540 committed Jan 22, 2022
1 parent 7c1b174 commit 44de753
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion php/src/Google/Protobuf/Internal/MapField.php
Expand Up @@ -133,8 +133,10 @@ public function getLegacyValueClass()
* @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)
*/
public function offsetGet($key): object
#[\ReturnTypeWillChange]
public function offsetGet($key)
{
return $this->container[$key];
}
Expand Down
8 changes: 6 additions & 2 deletions php/src/Google/Protobuf/Internal/MapFieldIter.php
Expand Up @@ -79,8 +79,10 @@ public function rewind()
* 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)
*/
public function current(): object
#[\ReturnTypeWillChange]
public function current()
{
return current($this->container);
}
Expand All @@ -89,8 +91,10 @@ public function current(): object
* Return the current key.
*
* @return object The current key.
* @todo need to add return type mixed (require update php version to 8.0)
*/
public function key(): object
#[\ReturnTypeWillChange]
public function key()
{
$key = key($this->container);
switch ($this->key_type) {
Expand Down
4 changes: 3 additions & 1 deletion php/src/Google/Protobuf/Internal/RepeatedField.php
Expand Up @@ -120,8 +120,10 @@ public function getLegacyClass()
* @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)
*/
public function offsetGet($offset): object
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->container[$offset];
}
Expand Down
8 changes: 6 additions & 2 deletions php/src/Google/Protobuf/Internal/RepeatedFieldIter.php
Expand Up @@ -82,8 +82,10 @@ public function rewind()
* 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)
*/
public function current(): object
#[\ReturnTypeWillChange]
public function current()
{
return $this->container[$this->position];
}
Expand All @@ -92,8 +94,10 @@ public function current(): object
* Return the current position.
*
* @return integer The current position.
* @todo need to add return type mixed (require update php version to 8.0)
*/
public function key(): int
#[\ReturnTypeWillChange]
public function key()
{
return $this->position;
}
Expand Down

0 comments on commit 44de753

Please sign in to comment.