Skip to content

Commit 268995f

Browse files
committed
Merge remote-tracking branch 'karyna/fix-magento-to-launch-with-php8.1-part1' into platform-health
2 parents ac72127 + d809e46 commit 268995f

File tree

14 files changed

+73
-15
lines changed

14 files changed

+73
-15
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: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function __construct(
5353
}
5454

5555
/**
56+
* Returns query select
57+
*
5658
* @return Select
5759
*/
5860
public function getSelect()
@@ -61,6 +63,8 @@ public function getSelect()
6163
}
6264

6365
/**
66+
* Returns Connection name
67+
*
6468
* @return string
6569
*/
6670
public function getConnectionName()
@@ -69,6 +73,8 @@ public function getConnectionName()
6973
}
7074

7175
/**
76+
* Returns configuration
77+
*
7278
* @return array
7379
*/
7480
public function getConfig()
@@ -77,11 +83,9 @@ public function getConfig()
7783
}
7884

7985
/**
80-
* Specify data which should be serialized to JSON
81-
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
82-
* @return mixed data which can be serialized by <b>json_encode</b>,
83-
* which is a value of any type other than a resource.
86+
* @inheritDoc
8487
*/
88+
#[\ReturnTypeWillChange]
8589
public function jsonSerialize()
8690
{
8791
return [

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function getParentItems($itemId)
242242
*
243243
* @param \Magento\Backend\Model\Menu $menu
244244
* @param string $itemId
245-
* @param array &$parents
245+
* @param array $parents
246246
* @return bool
247247
*/
248248
protected function _findParentItems($menu, $itemId, &$parents)
@@ -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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Iterator extends \FilterIterator
1717
*
1818
* @param \Iterator $iterator
1919
*/
20-
public function __construct(\Iterator $iterator)
20+
public function __construct(\Iterator $iterator) // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod
2121
{
2222
parent::__construct($iterator);
2323
}
@@ -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: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
namespace Magento\Catalog\Model\ResourceModel\Product\Collection;
77

88
/**
9-
* Class ProductLimitation
10-
*
119
* @api
1210
* @since 101.0.0
1311
*/
@@ -31,47 +29,61 @@ class ProductLimitation implements \ArrayAccess
3129
private $productLimitationFilters = [];
3230

3331
/**
32+
* Check if the value is set for the given offset.
33+
*
3434
* @param string $offset
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);
4142
}
4243

4344
/**
45+
* Get the value by provided offset.
46+
*
4447
* @param string $offset
4548
* @return mixed
4649
* @since 101.0.0
4750
*/
51+
#[\ReturnTypeWillChange]
4852
public function offsetGet($offset)
4953
{
5054
return $this->productLimitationFilters[$offset];
5155
}
5256

5357
/**
58+
* Set the given offset to filters.
59+
*
5460
* @param string $offset
5561
* @param mixed $value
5662
* @return void
5763
* @since 101.0.0
5864
*/
65+
#[\ReturnTypeWillChange]
5966
public function offsetSet($offset, $value)
6067
{
6168
$this->productLimitationFilters[$offset] = $value;
6269
}
6370

6471
/**
72+
* Unset the given offset from filters.
73+
*
6574
* @param string $offset
6675
* @return void
6776
* @since 101.0.0
6877
*/
78+
#[\ReturnTypeWillChange]
6979
public function offsetUnset($offset)
7080
{
7181
unset($this->productLimitationFilters[$offset]);
7282
}
7383

7484
/**
85+
* Returns Store ID.
86+
*
7587
* @return int|null
7688
* @since 101.0.0
7789
*/
@@ -81,6 +93,8 @@ public function getStoreId()
8193
}
8294

8395
/**
96+
* Returns category ID.
97+
*
8498
* @return int|null
8599
* @since 101.0.0
86100
*/
@@ -90,6 +104,8 @@ public function getCategoryId()
90104
}
91105

92106
/**
107+
* Returns is category an anchor.
108+
*
93109
* @return int|null
94110
* @since 101.0.0
95111
*/
@@ -99,6 +115,8 @@ public function getCategoryIsAnchor()
99115
}
100116

101117
/**
118+
* Returns visibility value.
119+
*
102120
* @return array|int|null
103121
* @since 101.0.0
104122
*/
@@ -108,6 +126,8 @@ public function getVisibility()
108126
}
109127

110128
/**
129+
* Returns website IDs.
130+
*
111131
* @return array|int|null
112132
* @since 101.0.0
113133
*/
@@ -117,6 +137,8 @@ public function getWebsiteIds()
117137
}
118138

119139
/**
140+
* Returns Store table.
141+
*
120142
* @return string|null
121143
* @since 101.0.0
122144
*/
@@ -137,13 +159,15 @@ public function isUsingPriceIndex()
137159
}
138160

139161
/**
162+
* Sets 'Use Price' index flag.
163+
*
140164
* @param bool $value
141165
* @return void
142166
* @since 101.0.0
143167
*/
144168
public function setUsePriceIndex($value)
145169
{
146-
$this->offsetSet('use_price_index', (bool)$value);
170+
$this->offsetSet('use_price_index', (bool) $value);
147171
}
148172

149173
/**

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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\ImportExport\Model\Import\AbstractEntity;
99

10+
// phpcs:disable Magento2.Classes.AbstractApi
1011
/**
1112
* Data source with columns for Magento_ImportExport
1213
*
@@ -83,6 +84,7 @@ public function getColNames()
8384
*
8485
* @return array
8586
*/
87+
#[\ReturnTypeWillChange]
8688
public function current()
8789
{
8890
$row = $this->_row;
@@ -101,6 +103,7 @@ public function current()
101103
*
102104
* @return void
103105
*/
106+
#[\ReturnTypeWillChange]
104107
public function next()
105108
{
106109
$this->_key++;
@@ -127,6 +130,7 @@ abstract protected function _getNextRow();
127130
*
128131
* @return int -1 if out of bounds, 0 or more otherwise
129132
*/
133+
#[\ReturnTypeWillChange]
130134
public function key()
131135
{
132136
return $this->_key;
@@ -137,6 +141,7 @@ public function key()
137141
*
138142
* @return bool
139143
*/
144+
#[\ReturnTypeWillChange]
140145
public function valid()
141146
{
142147
return -1 !== $this->_key;
@@ -147,6 +152,7 @@ public function valid()
147152
*
148153
* @return void
149154
*/
155+
#[\ReturnTypeWillChange]
150156
public function rewind()
151157
{
152158
$this->_key = -1;
@@ -161,6 +167,7 @@ public function rewind()
161167
* @return void
162168
* @throws \OutOfBoundsException
163169
*/
170+
#[\ReturnTypeWillChange]
164171
public function seek($position)
165172
{
166173
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) {

0 commit comments

Comments
 (0)