From 63020841a8257191bb666e363e6f98f152fc7dcc Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Sun, 22 Aug 2021 03:34:16 +0800 Subject: [PATCH] Fix for PHP8.1 --- src/Iterator/RecursiveDirectoryIterator.php | 3 +++ src/Iterator/RegexFilterIterator.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/Iterator/RecursiveDirectoryIterator.php b/src/Iterator/RecursiveDirectoryIterator.php index 0e8c482..95fa57c 100644 --- a/src/Iterator/RecursiveDirectoryIterator.php +++ b/src/Iterator/RecursiveDirectoryIterator.php @@ -50,6 +50,7 @@ public function __construct($path, $flags = 0) /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function getChildren() { return new static($this->getPathname(), $this->getFlags()); @@ -58,6 +59,7 @@ public function getChildren() /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function key() { $key = parent::key(); @@ -72,6 +74,7 @@ public function key() /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function current() { $current = parent::current(); diff --git a/src/Iterator/RegexFilterIterator.php b/src/Iterator/RegexFilterIterator.php index bce2e68..914cee0 100644 --- a/src/Iterator/RegexFilterIterator.php +++ b/src/Iterator/RegexFilterIterator.php @@ -94,6 +94,7 @@ public function __construct($regExp, $staticPrefix, Iterator $innerIterator, $mo /** * Rewind the iterator to the first position. */ + #[\ReturnTypeWillChange] public function rewind() { parent::rewind(); @@ -106,6 +107,7 @@ public function rewind() * * @return int The current position. */ + #[\ReturnTypeWillChange] public function key() { if (!$this->valid()) { @@ -124,6 +126,7 @@ public function key() * * @see Iterator::next() */ + #[\ReturnTypeWillChange] public function next() { if ($this->valid()) { @@ -137,6 +140,7 @@ public function next() * * @return bool Whether the path is accepted. */ + #[\ReturnTypeWillChange] public function accept() { $path = ($this->mode & self::FILTER_VALUE) ? $this->current() : parent::key();