Skip to content

Commit

Permalink
fix(php8.1): Add explicit @return annotation to suppress UserDeprecat…
Browse files Browse the repository at this point in the history
…ed notices (Symfony)
  • Loading branch information
grifx authored Mar 8, 2022
1 parent 1c444ad commit afdd9d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Future/CompletedFutureArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,42 @@ public function __construct(array $result)
}

#[\ReturnTypeWillChange]
/** @return bool */
public function offsetExists($offset)
{
return isset($this->result[$offset]);
}

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

#[\ReturnTypeWillChange]
/** @return void */
public function offsetSet($offset, $value)
{
$this->result[$offset] = $value;
}

#[\ReturnTypeWillChange]
/** @return void */
public function offsetUnset($offset)
{
unset($this->result[$offset]);
}

#[\ReturnTypeWillChange]
/** @return int */
public function count()
{
return count($this->result);
}

#[\ReturnTypeWillChange]
/** @return \ArrayIterator */
public function getIterator()
{
return new \ArrayIterator($this->result);
Expand Down
6 changes: 6 additions & 0 deletions src/Future/FutureArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,42 @@ class FutureArray implements FutureArrayInterface
use MagicFutureTrait;

#[\ReturnTypeWillChange]
/** @return bool */
public function offsetExists($offset)
{
return isset($this->_value[$offset]);
}

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

#[\ReturnTypeWillChange]
/** @return void */
public function offsetSet($offset, $value)
{
$this->_value[$offset] = $value;
}

#[\ReturnTypeWillChange]
/** @return void */
public function offsetUnset($offset)
{
unset($this->_value[$offset]);
}

#[\ReturnTypeWillChange]
/** @return int */
public function count()
{
return count($this->_value);
}

#[\ReturnTypeWillChange]
/** @return \ArrayIterator */
public function getIterator()
{
return new \ArrayIterator($this->_value);
Expand Down

0 comments on commit afdd9d9

Please sign in to comment.