Skip to content

Commit f7f4dcd

Browse files
authored
Add #[ReturnTypeWillChange] for PHP 8.1 support (#261)
1 parent c7cff60 commit f7f4dcd

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/main/php/org/bovigo/vfs/DotDirectory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class DotDirectory extends vfsStreamDirectory
1818
*
1919
* @return vfsStreamContainerIterator
2020
*/
21+
#[\ReturnTypeWillChange]
2122
public function getIterator()
2223
{
2324
return new \ArrayIterator(array());

src/main/php/org/bovigo/vfs/vfsStreamContainerIterator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct(array $children)
3838
/**
3939
* resets children pointer
4040
*/
41+
#[\ReturnTypeWillChange]
4142
public function rewind()
4243
{
4344
reset($this->children);
@@ -48,6 +49,7 @@ public function rewind()
4849
*
4950
* @return vfsStreamContent
5051
*/
52+
#[\ReturnTypeWillChange]
5153
public function current()
5254
{
5355
$child = current($this->children);
@@ -63,6 +65,7 @@ public function current()
6365
*
6466
* @return string
6567
*/
68+
#[\ReturnTypeWillChange]
6669
public function key()
6770
{
6871
$child = current($this->children);
@@ -76,6 +79,7 @@ public function key()
7679
/**
7780
* iterates to next child
7881
*/
82+
#[\ReturnTypeWillChange]
7983
public function next()
8084
{
8185
next($this->children);
@@ -86,6 +90,7 @@ public function next()
8690
*
8791
* @return bool
8892
*/
93+
#[\ReturnTypeWillChange]
8994
public function valid()
9095
{
9196
return (false !== current($this->children));

src/main/php/org/bovigo/vfs/vfsStreamDirectory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public function getChildren()
245245
*
246246
* @return vfsStreamContainerIterator
247247
*/
248+
#[\ReturnTypeWillChange]
248249
public function getIterator()
249250
{
250251
return new vfsStreamContainerIterator($this->children);

0 commit comments

Comments
 (0)