Skip to content

Fixes to launch Magento with PHP 8.1 - part 3 #34640

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

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
5 changes: 5 additions & 0 deletions lib/internal/Magento/Framework/DB/Query/BatchIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function __construct(
*
* @return Select
*/
#[\ReturnTypeWillChange]
public function current()
{
if (null == $this->currentSelect) {
Expand All @@ -107,6 +108,7 @@ public function current()
*
* @return Select
*/
#[\ReturnTypeWillChange]
public function next()
{
if (null == $this->currentSelect) {
Expand All @@ -129,6 +131,7 @@ public function next()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->iteration;
Expand All @@ -139,6 +142,7 @@ public function key()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->isValid;
Expand All @@ -149,6 +153,7 @@ public function valid()
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->minValue = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Magento\Framework\DB\Query;

/**
* Batch Iterator interface
* The batch queries iterator interface
*/
interface BatchIteratorInterface extends \Iterator
{
Expand All @@ -29,6 +29,7 @@ interface BatchIteratorInterface extends \Iterator
*
* @return \Magento\Framework\DB\Select
*/
#[\ReturnTypeWillChange]
public function current();

/**
Expand All @@ -38,6 +39,7 @@ public function current();
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key();

/**
Expand All @@ -48,6 +50,7 @@ public function key();
*
* @return \Magento\Framework\DB\Select
*/
#[\ReturnTypeWillChange]
public function next();

/**
Expand All @@ -57,12 +60,14 @@ public function next();
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind();

/**
* Checks if current position is valid
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid();
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function __construct(
*
* @return Select
*/
#[\ReturnTypeWillChange]
public function current()
{
if (null === $this->currentSelect) {
Expand All @@ -126,6 +127,7 @@ public function current()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->iteration;
Expand All @@ -139,6 +141,7 @@ public function key()
*
* @return Select
*/
#[\ReturnTypeWillChange]
public function next()
{
if (null === $this->currentSelect) {
Expand All @@ -162,6 +165,7 @@ public function next()
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->currentSelect = null;
Expand All @@ -175,6 +179,7 @@ public function rewind()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->isValid;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/Magento/Framework/DB/Sql/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Expression extends \Zend_Db_Expr implements ExpressionInterface, \JsonSeri
/**
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down
20 changes: 20 additions & 0 deletions lib/internal/Magento/Framework/DB/Tree/NodeSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public function __construct()
}

/**
* Adds a node to node list.
*
* @param Node $node
* @return int
*
Expand All @@ -59,30 +61,39 @@ public function addNode(Node $node)
}

/**
* Retrieves count elements in node list.
*
* @return int
*
* @deprecated 102.0.0
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->count;
}

/**
* Checks if current position is valid.
*
* @return bool
*
* @deprecated 102.0.0
*/
#[\ReturnTypeWillChange]
public function valid()
{
return isset($this->_nodes[$this->_current]);
}

/**
* Move forward to next element.
*
* @return false|int
*
* @deprecated 102.0.0
*/
#[\ReturnTypeWillChange]
public function next()
{
if ($this->_current > $this->_currentNode) {
Expand All @@ -93,30 +104,39 @@ public function next()
}

/**
* Retrieves the key of the current element.
*
* @return int
*
* @deprecated 102.0.0
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->_current;
}

/**
* Retrieves the current node.
*
* @return Node
*
* @deprecated 102.0.0
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->_nodes[$this->_current];
}

/**
* Rewinds the Iterator to the first element.
*
* @return void
*
* @deprecated 102.0.0
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->_current = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct(\Iterator $iterator, array $filters)
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function accept()
{
$current = str_replace('\\', '/', $this->current()->__toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ public function setData(array $data)
*
* @return Handler
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->object;
}

/**
* {@inheritdoc}
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function next()
{
next($this->data);
Expand All @@ -82,24 +84,27 @@ private function initObject(array $data)
}

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

/**
* {@inheritdoc}
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function valid()
{
return (bool)current($this->data);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function rewind()
{
reset($this->data);
Expand All @@ -109,16 +114,18 @@ public function rewind()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return array_key_exists($offset, $this->data);
}

/**
* {@inheritdoc}
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!$this->offsetExists($offset)) {
Expand All @@ -130,16 +137,18 @@ public function offsetGet($offset)
}

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

/**
* {@inheritdoc}
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->data[$offset]);
Expand Down
Loading