Skip to content

Commit

Permalink
adding return annotations to supress warnings (#3011)
Browse files Browse the repository at this point in the history
  • Loading branch information
RanVaknin authored Oct 7, 2024
1 parent fd017c3 commit 045a2bc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Api/Parser/DecodingEventStreamIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ public function key()
return $this->key;
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
Expand All @@ -202,6 +205,9 @@ public function next()
}
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
Expand Down
15 changes: 15 additions & 0 deletions src/Api/Parser/EventParsingIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,45 @@ private function chooseDecodingIterator($stream)
}
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->parseEvent($this->decodingIterator->current());
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->decodingIterator->key();
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->decodingIterator->next();
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->decodingIterator->rewind();
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
Expand Down
12 changes: 12 additions & 0 deletions src/ResultPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,27 @@ public function current()
return $this->valid() ? $this->result : false;
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->valid() ? $this->requestCount - 1 : null;
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->result = null;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
Expand Down Expand Up @@ -154,6 +163,9 @@ public function valid()
return false;
}

/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
Expand Down

0 comments on commit 045a2bc

Please sign in to comment.