Skip to content

Commit 65ebe4f

Browse files
Karyna Tsymbalkaryna-t
authored andcommitted
Fixes to launch Magento with PHP 8.1
1 parent e367c6b commit 65ebe4f

File tree

20 files changed

+108
-0
lines changed

20 files changed

+108
-0
lines changed

lib/internal/Magento/Framework/DB/Query/BatchIterator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function __construct(
9292
*
9393
* @return Select
9494
*/
95+
#[\ReturnTypeWillChange]
9596
public function current()
9697
{
9798
if (null == $this->currentSelect) {
@@ -107,6 +108,7 @@ public function current()
107108
*
108109
* @return Select
109110
*/
111+
#[\ReturnTypeWillChange]
110112
public function next()
111113
{
112114
if (null == $this->currentSelect) {
@@ -129,6 +131,7 @@ public function next()
129131
*
130132
* @return int
131133
*/
134+
#[\ReturnTypeWillChange]
132135
public function key()
133136
{
134137
return $this->iteration;
@@ -139,6 +142,7 @@ public function key()
139142
*
140143
* @return bool
141144
*/
145+
#[\ReturnTypeWillChange]
142146
public function valid()
143147
{
144148
return $this->isValid;
@@ -149,6 +153,7 @@ public function valid()
149153
*
150154
* @return void
151155
*/
156+
#[\ReturnTypeWillChange]
152157
public function rewind()
153158
{
154159
$this->minValue = 0;

lib/internal/Magento/Framework/DB/Query/BatchIteratorInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface BatchIteratorInterface extends \Iterator
2929
*
3030
* @return \Magento\Framework\DB\Select
3131
*/
32+
#[\ReturnTypeWillChange]
3233
public function current();
3334

3435
/**
@@ -38,6 +39,7 @@ public function current();
3839
*
3940
* @return int
4041
*/
42+
#[\ReturnTypeWillChange]
4143
public function key();
4244

4345
/**
@@ -48,6 +50,7 @@ public function key();
4850
*
4951
* @return \Magento\Framework\DB\Select
5052
*/
53+
#[\ReturnTypeWillChange]
5154
public function next();
5255

5356
/**
@@ -57,12 +60,14 @@ public function next();
5760
*
5861
* @return void
5962
*/
63+
#[\ReturnTypeWillChange]
6064
public function rewind();
6165

6266
/**
6367
* Checks if current position is valid
6468
*
6569
* @return bool
6670
*/
71+
#[\ReturnTypeWillChange]
6772
public function valid();
6873
}

lib/internal/Magento/Framework/DB/Query/BatchRangeIterator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function __construct(
110110
*
111111
* @return Select
112112
*/
113+
#[\ReturnTypeWillChange]
113114
public function current()
114115
{
115116
if (null === $this->currentSelect) {
@@ -126,6 +127,7 @@ public function current()
126127
*
127128
* @return int
128129
*/
130+
#[\ReturnTypeWillChange]
129131
public function key()
130132
{
131133
return $this->iteration;
@@ -139,6 +141,7 @@ public function key()
139141
*
140142
* @return Select
141143
*/
144+
#[\ReturnTypeWillChange]
142145
public function next()
143146
{
144147
if (null === $this->currentSelect) {
@@ -162,6 +165,7 @@ public function next()
162165
*
163166
* @return void
164167
*/
168+
#[\ReturnTypeWillChange]
165169
public function rewind()
166170
{
167171
$this->currentSelect = null;
@@ -175,6 +179,7 @@ public function rewind()
175179
*
176180
* @return bool
177181
*/
182+
#[\ReturnTypeWillChange]
178183
public function valid()
179184
{
180185
return $this->isValid;

lib/internal/Magento/Framework/DB/Sql/Expression.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Expression extends \Zend_Db_Expr implements ExpressionInterface, \JsonSeri
1313
/**
1414
* @inheritdoc
1515
*/
16+
#[\ReturnTypeWillChange]
1617
public function jsonSerialize()
1718
{
1819
return [

lib/internal/Magento/Framework/DB/Tree/NodeSet.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function addNode(Node $node)
6363
*
6464
* @deprecated 102.0.0
6565
*/
66+
#[\ReturnTypeWillChange]
6667
public function count()
6768
{
6869
return $this->count;
@@ -73,6 +74,7 @@ public function count()
7374
*
7475
* @deprecated 102.0.0
7576
*/
77+
#[\ReturnTypeWillChange]
7678
public function valid()
7779
{
7880
return isset($this->_nodes[$this->_current]);
@@ -83,6 +85,7 @@ public function valid()
8385
*
8486
* @deprecated 102.0.0
8587
*/
88+
#[\ReturnTypeWillChange]
8689
public function next()
8790
{
8891
if ($this->_current > $this->_currentNode) {
@@ -97,6 +100,7 @@ public function next()
97100
*
98101
* @deprecated 102.0.0
99102
*/
103+
#[\ReturnTypeWillChange]
100104
public function key()
101105
{
102106
return $this->_current;
@@ -107,6 +111,7 @@ public function key()
107111
*
108112
* @deprecated 102.0.0
109113
*/
114+
#[\ReturnTypeWillChange]
110115
public function current()
111116
{
112117
return $this->_nodes[$this->_current];
@@ -117,6 +122,7 @@ public function current()
117122
*
118123
* @deprecated 102.0.0
119124
*/
125+
#[\ReturnTypeWillChange]
120126
public function rewind()
121127
{
122128
$this->_current = 0;

lib/internal/Magento/Framework/Filesystem/Filter/ExcludeFilter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct(\Iterator $iterator, array $filters)
3535
*
3636
* @return bool
3737
*/
38+
#[\ReturnTypeWillChange]
3839
public function accept()
3940
{
4041
$current = str_replace('\\', '/', $this->current()->__toString());

lib/internal/Magento/Framework/MessageQueue/Consumer/Config/ConsumerConfigItem/Handler/Iterator.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function setData(array $data)
5454
*
5555
* @return Handler
5656
*/
57+
#[\ReturnTypeWillChange]
5758
public function current()
5859
{
5960
return $this->object;
@@ -62,6 +63,7 @@ public function current()
6263
/**
6364
* {@inheritdoc}
6465
*/
66+
#[\ReturnTypeWillChange]
6567
public function next()
6668
{
6769
next($this->data);
@@ -84,6 +86,7 @@ private function initObject(array $data)
8486
/**
8587
* {@inheritdoc}
8688
*/
89+
#[\ReturnTypeWillChange]
8790
public function key()
8891
{
8992
key($this->data);
@@ -92,6 +95,7 @@ public function key()
9295
/**
9396
* {@inheritdoc}
9497
*/
98+
#[\ReturnTypeWillChange]
9599
public function valid()
96100
{
97101
return (bool)current($this->data);
@@ -100,6 +104,7 @@ public function valid()
100104
/**
101105
* {@inheritdoc}
102106
*/
107+
#[\ReturnTypeWillChange]
103108
public function rewind()
104109
{
105110
reset($this->data);
@@ -111,6 +116,7 @@ public function rewind()
111116
/**
112117
* {@inheritdoc}
113118
*/
119+
#[\ReturnTypeWillChange]
114120
public function offsetExists($offset)
115121
{
116122
return array_key_exists($offset, $this->data);
@@ -119,6 +125,7 @@ public function offsetExists($offset)
119125
/**
120126
* {@inheritdoc}
121127
*/
128+
#[\ReturnTypeWillChange]
122129
public function offsetGet($offset)
123130
{
124131
if (!$this->offsetExists($offset)) {
@@ -132,6 +139,7 @@ public function offsetGet($offset)
132139
/**
133140
* {@inheritdoc}
134141
*/
142+
#[\ReturnTypeWillChange]
135143
public function offsetSet($offset, $value)
136144
{
137145
$this->data[$offset] = $value;
@@ -140,6 +148,7 @@ public function offsetSet($offset, $value)
140148
/**
141149
* {@inheritdoc}
142150
*/
151+
#[\ReturnTypeWillChange]
143152
public function offsetUnset($offset)
144153
{
145154
unset($this->data[$offset]);

lib/internal/Magento/Framework/MessageQueue/Consumer/Config/ConsumerConfigItem/Iterator.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function __construct(Data $configData, ConsumerConfigItemFactory $itemFac
4646
*
4747
* @return ConsumerConfigItem
4848
*/
49+
#[\ReturnTypeWillChange]
4950
public function current()
5051
{
5152
return $this->object;
@@ -54,6 +55,7 @@ public function current()
5455
/**
5556
* {@inheritdoc}
5657
*/
58+
#[\ReturnTypeWillChange]
5759
public function next()
5860
{
5961
next($this->data);
@@ -76,6 +78,7 @@ private function initObject(array $data)
7678
/**
7779
* {@inheritdoc}
7880
*/
81+
#[\ReturnTypeWillChange]
7982
public function key()
8083
{
8184
key($this->data);
@@ -84,6 +87,7 @@ public function key()
8487
/**
8588
* {@inheritdoc}
8689
*/
90+
#[\ReturnTypeWillChange]
8791
public function valid()
8892
{
8993
return (bool)current($this->data);
@@ -92,6 +96,7 @@ public function valid()
9296
/**
9397
* {@inheritdoc}
9498
*/
99+
#[\ReturnTypeWillChange]
95100
public function rewind()
96101
{
97102
reset($this->data);
@@ -103,6 +108,7 @@ public function rewind()
103108
/**
104109
* {@inheritdoc}
105110
*/
111+
#[\ReturnTypeWillChange]
106112
public function offsetExists($offset)
107113
{
108114
return array_key_exists($offset, $this->data);
@@ -111,6 +117,7 @@ public function offsetExists($offset)
111117
/**
112118
* {@inheritdoc}
113119
*/
120+
#[\ReturnTypeWillChange]
114121
public function offsetGet($offset)
115122
{
116123
if (!$this->offsetExists($offset)) {
@@ -124,6 +131,7 @@ public function offsetGet($offset)
124131
/**
125132
* {@inheritdoc}
126133
*/
134+
#[\ReturnTypeWillChange]
127135
public function offsetSet($offset, $value)
128136
{
129137
$this->data[$offset] = $value;
@@ -132,6 +140,7 @@ public function offsetSet($offset, $value)
132140
/**
133141
* {@inheritdoc}
134142
*/
143+
#[\ReturnTypeWillChange]
135144
public function offsetUnset($offset)
136145
{
137146
unset($this->data[$offset]);

lib/internal/Magento/Framework/MessageQueue/Publisher/Config/PublisherConfigItem/Iterator.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function __construct(Data $configData, PublisherConfigItemFactory $itemFa
4646
*
4747
* @return PublisherConfigItem
4848
*/
49+
#[\ReturnTypeWillChange]
4950
public function current()
5051
{
5152
return $this->object;
@@ -54,6 +55,7 @@ public function current()
5455
/**
5556
* {@inheritdoc}
5657
*/
58+
#[\ReturnTypeWillChange]
5759
public function next()
5860
{
5961
next($this->data);
@@ -79,6 +81,7 @@ private function initObject(array $data)
7981
/**
8082
* {@inheritdoc}
8183
*/
84+
#[\ReturnTypeWillChange]
8285
public function key()
8386
{
8487
key($this->data);
@@ -87,6 +90,7 @@ public function key()
8790
/**
8891
* {@inheritdoc}
8992
*/
93+
#[\ReturnTypeWillChange]
9094
public function valid()
9195
{
9296
return (bool)current($this->data);
@@ -95,6 +99,7 @@ public function valid()
9599
/**
96100
* {@inheritdoc}
97101
*/
102+
#[\ReturnTypeWillChange]
98103
public function rewind()
99104
{
100105
reset($this->data);
@@ -109,6 +114,7 @@ public function rewind()
109114
/**
110115
* {@inheritdoc}
111116
*/
117+
#[\ReturnTypeWillChange]
112118
public function offsetExists($offset)
113119
{
114120
return array_key_exists($offset, $this->data);
@@ -117,6 +123,7 @@ public function offsetExists($offset)
117123
/**
118124
* {@inheritdoc}
119125
*/
126+
#[\ReturnTypeWillChange]
120127
public function offsetGet($offset)
121128
{
122129
if (!$this->offsetExists($offset) || $this->data[$offset]['disabled'] == true) {
@@ -130,6 +137,7 @@ public function offsetGet($offset)
130137
/**
131138
* {@inheritdoc}
132139
*/
140+
#[\ReturnTypeWillChange]
133141
public function offsetSet($offset, $value)
134142
{
135143
$this->data[$offset] = $value;
@@ -138,6 +146,7 @@ public function offsetSet($offset, $value)
138146
/**
139147
* {@inheritdoc}
140148
*/
149+
#[\ReturnTypeWillChange]
141150
public function offsetUnset($offset)
142151
{
143152
unset($this->data[$offset]);

0 commit comments

Comments
 (0)