Skip to content

Commit 2bc0f35

Browse files
Karyna Tsymbalkaryna-t
Karyna Tsymbal
authored andcommitted
Fix Return Type deprecation notcies
1 parent 3aff24c commit 2bc0f35

File tree

51 files changed

+215
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+215
-2
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 & 1 deletion
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,7 +295,7 @@ public function toArray()
294295
* @return void
295296
* @since 100.2.0
296297
*/
297-
public function unserialize($serialized)
298+
public function unserialize($serialized): void
298299
{
299300
$data = $this->serializer->unserialize($serialized);
300301
$this->populateFromArray($data);

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Iterator extends \ArrayIterator
1717
*
1818
* @return void
1919
*/
20-
public function rewind()
20+
public function rewind(): void
2121
{
2222
$this->ksort();
2323
parent::rewind();

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: 6 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);
@@ -144,6 +149,7 @@ public function rewind()
144149
* @param \Magento\Config\Model\Config\Structure\ElementInterface $element
145150
* @return bool
146151
*/
152+
#[\ReturnTypeWillChange]
147153
public function isLast(\Magento\Config\Model\Config\Structure\ElementInterface $element)
148154
{
149155
return $element->getId() == $this->_lastId;

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;

lib/internal/Magento/Framework/Api/Search/Document.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function setCustomAttributes(array $attributes)
7070
* @return \ArrayIterator
7171
* @since 100.1.0
7272
*/
73+
#[\ReturnTypeWillChange]
7374
public function getIterator()
7475
{
7576
$attributes = (array)$this->getCustomAttributes();

lib/internal/Magento/Framework/App/Cache/Frontend/Pool.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ protected function _getCacheSettings()
9797
*
9898
* @return \Magento\Framework\Cache\FrontendInterface
9999
*/
100+
#[\ReturnTypeWillChange]
100101
public function current()
101102
{
102103
$this->_initialize();
@@ -106,6 +107,7 @@ public function current()
106107
/**
107108
* @inheritdoc
108109
*/
110+
#[\ReturnTypeWillChange]
109111
public function key()
110112
{
111113
$this->_initialize();
@@ -115,6 +117,7 @@ public function key()
115117
/**
116118
* @inheritdoc
117119
*/
120+
#[\ReturnTypeWillChange]
118121
public function next()
119122
{
120123
$this->_initialize();
@@ -124,6 +127,7 @@ public function next()
124127
/**
125128
* @inheritdoc
126129
*/
130+
#[\ReturnTypeWillChange]
127131
public function rewind()
128132
{
129133
$this->_initialize();
@@ -133,6 +137,7 @@ public function rewind()
133137
/**
134138
* @inheritdoc
135139
*/
140+
#[\ReturnTypeWillChange]
136141
public function valid()
137142
{
138143
$this->_initialize();

lib/internal/Magento/Framework/App/RouterList.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ protected function getRouterInstance($routerId)
6060
* @link http://php.net/manual/en/iterator.current.php
6161
* @return RouterInterface
6262
*/
63+
#[\ReturnTypeWillChange]
6364
public function current()
6465
{
6566
return $this->getRouterInstance($this->key());
@@ -71,6 +72,7 @@ public function current()
7172
* @link http://php.net/manual/en/iterator.next.php
7273
* @return void Any returned value is ignored.
7374
*/
75+
#[\ReturnTypeWillChange]
7476
public function next()
7577
{
7678
next($this->routerList);
@@ -82,6 +84,7 @@ public function next()
8284
* @link http://php.net/manual/en/iterator.key.php
8385
* @return string|int|null
8486
*/
87+
#[\ReturnTypeWillChange]
8588
public function key()
8689
{
8790
return key($this->routerList);
@@ -94,6 +97,7 @@ public function key()
9497
* @return boolean The return value will be casted to boolean and then evaluated.
9598
* Returns true on success or false on failure.
9699
*/
100+
#[\ReturnTypeWillChange]
97101
public function valid()
98102
{
99103
return !!current($this->routerList);
@@ -105,6 +109,7 @@ public function valid()
105109
* @link http://php.net/manual/en/iterator.rewind.php
106110
* @return void Any returned value is ignored.
107111
*/
112+
#[\ReturnTypeWillChange]
108113
public function rewind()
109114
{
110115
reset($this->routerList);

lib/internal/Magento/Framework/Backup/Filesystem/Iterator/File.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class File extends \SplFileObject
2424
*
2525
* @return string
2626
*/
27+
#[\ReturnTypeWillChange]
2728
public function current()
2829
{
2930
return $this->_currentStatement;
@@ -34,6 +35,7 @@ public function current()
3435
*
3536
* @return void
3637
*/
38+
#[\ReturnTypeWillChange]
3739
public function next()
3840
{
3941
$this->_currentStatement = '';
@@ -53,6 +55,7 @@ public function next()
5355
*
5456
* @return void
5557
*/
58+
#[\ReturnTypeWillChange]
5659
public function rewind()
5760
{
5861
parent::rewind();

lib/internal/Magento/Framework/Backup/Filesystem/Iterator/Filter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function __construct(Iterator $iterator, array $filters)
3939
*
4040
* @return bool
4141
*/
42+
#[\ReturnTypeWillChange]
4243
public function accept()
4344
{
4445
$current = str_replace('\\', '/', $this->current()->__toString());

0 commit comments

Comments
 (0)