Skip to content

Commit 1db34cc

Browse files
Karyna Tsymbalkaryna-t
Karyna Tsymbal
authored andcommitted
Fixes to launch Magento with PHP 8.1
1 parent 0af0fba commit 1db34cc

File tree

14 files changed

+33
-0
lines changed

14 files changed

+33
-0
lines changed

app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function __construct(
3434
*
3535
* @return array
3636
*/
37+
#[\ReturnTypeWillChange]
3738
public function current()
3839
{
3940
$current = parent::current();

app/code/Magento/Analytics/ReportXml/Query.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function getConfig()
8282
* @return mixed data which can be serialized by <b>json_encode</b>,
8383
* which is a value of any type other than a resource.
8484
*/
85+
#[\ReturnTypeWillChange]
8586
public function jsonSerialize()
8687
{
8788
return [

app/code/Magento/Backend/Model/Menu.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ protected function _findParentItems($menu, $itemId, &$parents)
267267
*
268268
* @return string
269269
*/
270+
#[\ReturnTypeWillChange]
270271
public function serialize()
271272
{
272273
return $this->serializer->serialize($this->toArray());
@@ -294,6 +295,7 @@ public function toArray()
294295
* @return void
295296
* @since 100.2.0
296297
*/
298+
#[\ReturnTypeWillChange]
297299
public function unserialize($serialized)
298300
{
299301
$data = $this->serializer->unserialize($serialized);

app/code/Magento/Backend/Model/Menu/Filter/Iterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function __construct(\Iterator $iterator)
2727
*
2828
* @return bool true if the current element is acceptable, otherwise false.
2929
*/
30+
#[\ReturnTypeWillChange]
3031
public function accept()
3132
{
3233
return !($this->current()->isDisabled() || !$this->current()->isAllowed());

app/code/Magento/Backend/Model/Menu/Iterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Iterator extends \ArrayIterator
1717
*
1818
* @return void
1919
*/
20+
#[\ReturnTypeWillChange]
2021
public function rewind()
2122
{
2223
$this->ksort();

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ProductLimitation implements \ArrayAccess
3535
* @return bool
3636
* @since 101.0.0
3737
*/
38+
#[\ReturnTypeWillChange]
3839
public function offsetExists($offset)
3940
{
4041
return array_key_exists($offset, $this->productLimitationFilters);
@@ -45,6 +46,7 @@ public function offsetExists($offset)
4546
* @return mixed
4647
* @since 101.0.0
4748
*/
49+
#[\ReturnTypeWillChange]
4850
public function offsetGet($offset)
4951
{
5052
return $this->productLimitationFilters[$offset];
@@ -56,6 +58,7 @@ public function offsetGet($offset)
5658
* @return void
5759
* @since 101.0.0
5860
*/
61+
#[\ReturnTypeWillChange]
5962
public function offsetSet($offset, $value)
6063
{
6164
$this->productLimitationFilters[$offset] = $value;
@@ -66,6 +69,7 @@ public function offsetSet($offset, $value)
6669
* @return void
6770
* @since 101.0.0
6871
*/
72+
#[\ReturnTypeWillChange]
6973
public function offsetUnset($offset)
7074
{
7175
unset($this->productLimitationFilters[$offset]);

app/code/Magento/Config/Model/Config/Structure/Element/Iterator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function setElements(array $elements, $scope)
6969
*
7070
* @return \Magento\Config\Model\Config\StructureElementInterface
7171
*/
72+
#[\ReturnTypeWillChange]
7273
public function current()
7374
{
7475
return $this->_flyweight;
@@ -79,6 +80,7 @@ public function current()
7980
*
8081
* @return void Any returned value is ignored.
8182
*/
83+
#[\ReturnTypeWillChange]
8284
public function next()
8385
{
8486
next($this->_elements);
@@ -106,6 +108,7 @@ protected function _initFlyweight(array $element)
106108
*
107109
* @return void
108110
*/
111+
#[\ReturnTypeWillChange]
109112
public function key()
110113
{
111114
key($this->_elements);
@@ -117,6 +120,7 @@ public function key()
117120
* @return bool The return value will be casted to boolean and then evaluated.
118121
* Returns true on success or false on failure.
119122
*/
123+
#[\ReturnTypeWillChange]
120124
public function valid()
121125
{
122126
return (bool)current($this->_elements);
@@ -127,6 +131,7 @@ public function valid()
127131
*
128132
* @return void Any returned value is ignored.
129133
*/
134+
#[\ReturnTypeWillChange]
130135
public function rewind()
131136
{
132137
reset($this->_elements);

app/code/Magento/Customer/Model/Indexer/Source.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function addFieldToFilter($attribute, $condition = null)
8282
/**
8383
* @inheritdoc
8484
*/
85+
#[\ReturnTypeWillChange]
8586
public function count()
8687
{
8788
return $this->customerCollection->getSize();
@@ -92,6 +93,7 @@ public function count()
9293
*
9394
* @return Traversable
9495
*/
96+
#[\ReturnTypeWillChange]
9597
public function getIterator()
9698
{
9799
$this->customerCollection->setPageSize($this->batchSize);

app/code/Magento/Customer/Ui/Component/MassAction/Group/Options.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function __construct(
8181
*
8282
* @return array
8383
*/
84+
#[\ReturnTypeWillChange]
8485
public function jsonSerialize()
8586
{
8687
if ($this->options === null) {

app/code/Magento/ImportExport/Model/Import/AbstractSource.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function getColNames()
8383
*
8484
* @return array
8585
*/
86+
#[\ReturnTypeWillChange]
8687
public function current()
8788
{
8889
$row = $this->_row;
@@ -101,6 +102,7 @@ public function current()
101102
*
102103
* @return void
103104
*/
105+
#[\ReturnTypeWillChange]
104106
public function next()
105107
{
106108
$this->_key++;
@@ -127,6 +129,7 @@ abstract protected function _getNextRow();
127129
*
128130
* @return int -1 if out of bounds, 0 or more otherwise
129131
*/
132+
#[\ReturnTypeWillChange]
130133
public function key()
131134
{
132135
return $this->_key;
@@ -137,6 +140,7 @@ public function key()
137140
*
138141
* @return bool
139142
*/
143+
#[\ReturnTypeWillChange]
140144
public function valid()
141145
{
142146
return -1 !== $this->_key;
@@ -147,6 +151,7 @@ public function valid()
147151
*
148152
* @return void
149153
*/
154+
#[\ReturnTypeWillChange]
150155
public function rewind()
151156
{
152157
$this->_key = -1;
@@ -161,6 +166,7 @@ public function rewind()
161166
* @return void
162167
* @throws \OutOfBoundsException
163168
*/
169+
#[\ReturnTypeWillChange]
164170
public function seek($position)
165171
{
166172
if ($position == $this->_key) {

app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ protected function _construct()
5656
*
5757
* @return \Iterator
5858
*/
59+
#[\ReturnTypeWillChange]
5960
public function getIterator()
6061
{
6162
$connection = $this->getConnection();

app/code/Magento/Shipping/Model/Simplexml/Element.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Element extends \Magento\Framework\Simplexml\Element
2020
* @param string $namespace If specified, the namespace to which the attribute belongs.
2121
* @return void
2222
*/
23+
#[\ReturnTypeWillChange]
2324
public function addAttribute($name, $value = null, $namespace = null)
2425
{
2526
$value = $value !== null ? $this->xmlentities($value) : '';
@@ -34,6 +35,7 @@ public function addAttribute($name, $value = null, $namespace = null)
3435
* @param string $namespace If specified, the namespace to which the child element belongs.
3536
* @return \Magento\Shipping\Model\Simplexml\Element
3637
*/
38+
#[\ReturnTypeWillChange]
3739
public function addChild($name, $value = null, $namespace = null)
3840
{
3941
if ($value !== null) {

app/code/Magento/Ui/DataProvider/AbstractDataProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ public function getData()
267267
*
268268
* @return int
269269
*/
270+
#[\ReturnTypeWillChange]
270271
public function count()
271272
{
272273
return $this->getCollection()->count();

app/code/Magento/Ui/Model/Export/SearchResultIterator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct(
2424
/**
2525
* @return array|mixed
2626
*/
27+
#[\ReturnTypeWillChange]
2728
public function current()
2829
{
2930
return current($this->items);
@@ -32,6 +33,7 @@ public function current()
3233
/**
3334
* @return int|mixed
3435
*/
36+
#[\ReturnTypeWillChange]
3537
public function key()
3638
{
3739
return key($this->items);
@@ -40,6 +42,7 @@ public function key()
4042
/**
4143
* @return void
4244
*/
45+
#[\ReturnTypeWillChange]
4346
public function next()
4447
{
4548
next($this->items);
@@ -48,6 +51,7 @@ public function next()
4851
/**
4952
* @return void
5053
*/
54+
#[\ReturnTypeWillChange]
5155
public function rewind()
5256
{
5357
reset($this->items);
@@ -56,6 +60,7 @@ public function rewind()
5660
/**
5761
* @return bool
5862
*/
63+
#[\ReturnTypeWillChange]
5964
public function valid()
6065
{
6166
return $this->key() !== null;

0 commit comments

Comments
 (0)