Skip to content

Commit 1e7fdb7

Browse files
committed
Merge remote-tracking branch 'karyna/fix-magento-to-launch-with-php8.1-part2' into platform-health
2 parents 144c679 + 8ec5e54 commit 1e7fdb7

File tree

17 files changed

+109
-55
lines changed

17 files changed

+109
-55
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@
1414
class Document extends AbstractSimpleObject implements DocumentInterface, \IteratorAggregate
1515
{
1616
/**
17-
* {@inheritdoc}
17+
* @inheritdoc
1818
*/
1919
public function getId()
2020
{
2121
return $this->_get(self::ID);
2222
}
2323

2424
/**
25-
* {@inheritdoc}
25+
* @inheritdoc
2626
*/
2727
public function setId($id)
2828
{
2929
return $this->setData(self::ID, $id);
3030
}
3131

3232
/**
33-
* {@inheritdoc}
33+
* @inheritdoc
3434
*/
3535
public function getCustomAttribute($attributeCode)
3636
{
3737
return $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode] ?? null;
3838
}
3939

4040
/**
41-
* {@inheritdoc}
41+
* @inheritdoc
4242
*/
4343
public function setCustomAttribute($attributeCode, $attributeValue)
4444
{
@@ -49,15 +49,15 @@ public function setCustomAttribute($attributeCode, $attributeValue)
4949
}
5050

5151
/**
52-
* {@inheritdoc}
52+
* @inheritdoc
5353
*/
5454
public function getCustomAttributes()
5555
{
5656
return $this->_get(self::CUSTOM_ATTRIBUTES);
5757
}
5858

5959
/**
60-
* {@inheritdoc}
60+
* @inheritdoc
6161
*/
6262
public function setCustomAttributes(array $attributes)
6363
{
@@ -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: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?php
22
/**
3-
* Router list
4-
* Used as a container for list of routers
5-
*
63
* Copyright © Magento, Inc. All rights reserved.
74
* See COPYING.txt for license details.
85
*/
96
namespace Magento\Framework\App;
107

8+
/** * Used as a container for list of routers.
9+
*/
1110
class RouterList implements RouterListInterface
1211
{
1312
/**
@@ -55,56 +54,45 @@ protected function getRouterInstance($routerId)
5554
}
5655

5756
/**
58-
* (PHP 5 &gt;= 5.0.0)<br/>
59-
* Return the current element
60-
* @link http://php.net/manual/en/iterator.current.php
61-
* @return RouterInterface
57+
* @inheritdoc
6258
*/
59+
#[\ReturnTypeWillChange]
6360
public function current()
6461
{
6562
return $this->getRouterInstance($this->key());
6663
}
6764

6865
/**
69-
* (PHP 5 &gt;= 5.0.0)<br/>
70-
* Move forward to next element
71-
* @link http://php.net/manual/en/iterator.next.php
72-
* @return void Any returned value is ignored.
66+
* @inheritdoc
7367
*/
68+
#[\ReturnTypeWillChange]
7469
public function next()
7570
{
7671
next($this->routerList);
7772
}
7873

7974
/**
80-
* (PHP 5 &gt;= 5.0.0)<br/>
81-
* Return the key of the current element
82-
* @link http://php.net/manual/en/iterator.key.php
83-
* @return string|int|null
75+
* @inheritdoc
8476
*/
77+
#[\ReturnTypeWillChange]
8578
public function key()
8679
{
8780
return key($this->routerList);
8881
}
8982

9083
/**
91-
* (PHP 5 &gt;= 5.0.0)<br/>
92-
* Checks if current position is valid
93-
* @link http://php.net/manual/en/iterator.valid.php
94-
* @return boolean The return value will be casted to boolean and then evaluated.
95-
* Returns true on success or false on failure.
84+
* @inheritdoc
9685
*/
86+
#[\ReturnTypeWillChange]
9787
public function valid()
9888
{
9989
return !!current($this->routerList);
10090
}
10191

10292
/**
103-
* (PHP 5 &gt;= 5.0.0)<br/>
104-
* Rewind the Iterator to the first element
105-
* @link http://php.net/manual/en/iterator.rewind.php
106-
* @return void Any returned value is ignored.
93+
* @inheritdoc
10794
*/
95+
#[\ReturnTypeWillChange]
10896
public function rewind()
10997
{
11098
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());

lib/internal/Magento/Framework/Config/CompositeFileIterator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function __construct(ReadFactory $readFactory, array $paths, FileIterator
3434
/**
3535
* @inheritDoc
3636
*/
37+
#[\ReturnTypeWillChange]
3738
public function rewind()
3839
{
3940
$this->existingIterator->rewind();
@@ -43,6 +44,7 @@ public function rewind()
4344
/**
4445
* @inheritDoc
4546
*/
47+
#[\ReturnTypeWillChange]
4648
public function current()
4749
{
4850
if ($this->existingIterator->valid()) {
@@ -55,6 +57,7 @@ public function current()
5557
/**
5658
* @inheritDoc
5759
*/
60+
#[\ReturnTypeWillChange]
5861
public function key()
5962
{
6063
if ($this->existingIterator->valid()) {
@@ -67,6 +70,7 @@ public function key()
6770
/**
6871
* @inheritDoc
6972
*/
73+
#[\ReturnTypeWillChange]
7074
public function next()
7175
{
7276
if ($this->existingIterator->valid()) {
@@ -79,6 +83,7 @@ public function next()
7983
/**
8084
* @inheritDoc
8185
*/
86+
#[\ReturnTypeWillChange]
8287
public function valid()
8388
{
8489
return $this->existingIterator->valid() || parent::valid();
@@ -95,6 +100,7 @@ public function toArray()
95100
/**
96101
* @inheritDoc
97102
*/
103+
#[\ReturnTypeWillChange]
98104
public function count()
99105
{
100106
return $this->existingIterator->count() + parent::count();

lib/internal/Magento/Framework/Config/FileIterator.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,22 @@
1010
use Magento\Framework\Filesystem\File\ReadFactory;
1111

1212
/**
13-
* Class FileIterator
1413
* @api
1514
* @since 100.0.2
1615
*/
1716
class FileIterator implements \Iterator, \Countable
1817
{
1918
/**
20-
* Paths
21-
*
2219
* @var array
2320
*/
2421
protected $paths = [];
2522

2623
/**
27-
* Position
28-
*
2924
* @var int
3025
*/
3126
protected $position;
3227

3328
/**
34-
* File read factory
35-
*
3629
* @var ReadFactory
3730
*/
3831
protected $fileReadFactory;
@@ -55,6 +48,7 @@ public function __construct(ReadFactory $readFactory, array $paths)
5548
*
5649
* @return void
5750
*/
51+
#[\ReturnTypeWillChange]
5852
public function rewind()
5953
{
6054
reset($this->paths);
@@ -65,6 +59,7 @@ public function rewind()
6559
*
6660
* @return string
6761
*/
62+
#[\ReturnTypeWillChange]
6863
public function current()
6964
{
7065
$fileRead = $this->fileReadFactory->create($this->key(), DriverPool::FILE);
@@ -76,6 +71,7 @@ public function current()
7671
*
7772
* @return mixed
7873
*/
74+
#[\ReturnTypeWillChange]
7975
public function key()
8076
{
8177
return current($this->paths);
@@ -86,6 +82,7 @@ public function key()
8682
*
8783
* @return void
8884
*/
85+
#[\ReturnTypeWillChange]
8986
public function next()
9087
{
9188
next($this->paths);
@@ -96,6 +93,7 @@ public function next()
9693
*
9794
* @return bool
9895
*/
96+
#[\ReturnTypeWillChange]
9997
public function valid()
10098
{
10199
return (bool) $this->key();
@@ -106,6 +104,7 @@ public function valid()
106104
*
107105
* @return array
108106
*/
107+
#[\ReturnTypeWillChange]
109108
public function toArray()
110109
{
111110
$result = [];
@@ -120,6 +119,7 @@ public function toArray()
120119
*
121120
* @return int
122121
*/
122+
#[\ReturnTypeWillChange]
123123
public function count()
124124
{
125125
return count($this->paths);

lib/internal/Magento/Framework/Data/Collection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ protected function _toOptionArray($valueField = 'id', $labelField = 'name', $add
780780
*
781781
* @return array
782782
*/
783+
#[\ReturnTypeWillChange]
783784
public function toOptionArray()
784785
{
785786
return $this->_toOptionArray();
@@ -834,6 +835,7 @@ public function getItemById($idValue)
834835
*
835836
* @return \ArrayIterator
836837
*/
838+
#[\ReturnTypeWillChange]
837839
public function getIterator()
838840
{
839841
$this->load();
@@ -845,6 +847,7 @@ public function getIterator()
845847
*
846848
* @return int
847849
*/
850+
#[\ReturnTypeWillChange]
848851
public function count()
849852
{
850853
$this->load();

0 commit comments

Comments
 (0)