Skip to content

Commit 7d44398

Browse files
committed
fix: Hopefully fix issues with PHP 8.1.
1 parent e7cc646 commit 7d44398

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Node/Node.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace loophp\phptree\Node;
1111

1212
use InvalidArgumentException;
13+
use ReturnTypeWillChange;
1314
use Traversable;
1415

1516
use function array_key_exists;
@@ -133,9 +134,9 @@ public function getAncestors(): Traversable
133134
}
134135

135136
/**
136-
* @return Traversable<\loophp\phptree\Node\NodeInterface>
137+
* @return Traversable<NodeInterface>
137138
*/
138-
public function getIterator()
139+
public function getIterator(): Traversable
139140
{
140141
yield from $this->all();
141142
}
@@ -204,6 +205,7 @@ public function level(int $level): Traversable
204205
*
205206
* @return bool
206207
*/
208+
#[ReturnTypeWillChange]
207209
public function offsetExists($offset)
208210
{
209211
return array_key_exists($offset, $this->children);
@@ -214,6 +216,7 @@ public function offsetExists($offset)
214216
*
215217
* @return NodeInterface
216218
*/
219+
#[ReturnTypeWillChange]
217220
public function offsetGet($offset)
218221
{
219222
return $this->children[$offset];
@@ -239,6 +242,7 @@ public function offsetSet($offset, $value): void
239242
*
240243
* @return void
241244
*/
245+
#[ReturnTypeWillChange]
242246
public function offsetUnset($offset)
243247
{
244248
unset($this->children[$offset]);

0 commit comments

Comments
 (0)