Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReturnTypeWillChange attributes #26

Merged
merged 2 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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