Skip to content

Commit

Permalink
Add ReturnTypeWillChange attributes (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
toooni authored Mar 25, 2022
1 parent b5ba2e3 commit 46b2a9d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Result/AbstractResultsIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ protected function getManager()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->count;
Expand All @@ -175,6 +176,7 @@ public function count()
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->getDocument($this->key());
Expand All @@ -183,6 +185,7 @@ public function current()
/**
* Move forward to next element.
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->advanceKey();
Expand All @@ -193,6 +196,7 @@ public function next()
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->key;
Expand All @@ -203,6 +207,7 @@ public function key()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
if (!isset($this->documents)) {
Expand All @@ -222,6 +227,7 @@ public function valid()
/**
* Rewind the Iterator to the first element.
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->key = 0;
Expand Down
4 changes: 4 additions & 0 deletions Result/Aggregation/AggregationValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public function find($path)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return array_key_exists($offset, $this->rawData);
Expand All @@ -123,6 +124,7 @@ public function offsetExists($offset)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!isset($this->rawData[$offset])) {
Expand All @@ -135,6 +137,7 @@ public function offsetGet($offset)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new \LogicException('Aggregation result can not be changed on runtime.');
Expand All @@ -143,6 +146,7 @@ public function offsetSet($offset, $value)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new \LogicException('Aggregation result can not be changed on runtime.');
Expand Down
4 changes: 4 additions & 0 deletions Result/ArrayIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ArrayIterator extends AbstractResultsIterator implements \ArrayAccess
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return $this->documentExists($offset);
Expand All @@ -27,6 +28,7 @@ public function offsetExists($offset)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getDocument($offset);
Expand All @@ -35,6 +37,7 @@ public function offsetGet($offset)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->documents[$offset] = $value;
Expand All @@ -43,6 +46,7 @@ public function offsetSet($offset, $value)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->documents[$offset]);
Expand Down
6 changes: 6 additions & 0 deletions Service/Json/JsonReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ protected function configureResolver(OptionsResolver $resolver)
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
if ($this->currentLine === null) {
Expand All @@ -202,6 +203,7 @@ public function current()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->readLine();
Expand All @@ -212,6 +214,7 @@ public function next()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->key;
Expand All @@ -220,6 +223,7 @@ public function key()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function valid()
{
return !feof($this->getFileHandler()) && $this->currentLine;
Expand All @@ -228,6 +232,7 @@ public function valid()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function rewind()
{
rewind($this->getFileHandler());
Expand All @@ -239,6 +244,7 @@ public function rewind()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count()
{
$metadata = $this->getMetadata();
Expand Down

0 comments on commit 46b2a9d

Please sign in to comment.