File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
QueryPath Changelog
2
2
===========================
3
3
4
+ # 3.2.1
5
+ - Fix QueryPath\QueryPathIterator::current() deprecation notice in PHP8.1
6
+
4
7
# 3.2.0
5
8
6
9
- Fixes a number of type-related errors on PHP 8.1
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class QueryPathIterator extends IteratorIterator
26
26
public $ options = [];
27
27
private $ qp ;
28
28
29
+ #[\ReturnTypeWillChange]
29
30
public function current ()
30
31
{
31
32
if (! isset ($ this ->qp )) {
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace QueryPathTests ;
4
+
5
+ class QueryPathIteratorTest extends TestCase
6
+ {
7
+ public function testCurrent ()
8
+ {
9
+ $ qp = qp ('<ul><li>Item1</li><li>Item2</li></ul> ' , 'li ' );
10
+
11
+ $ iterator = $ qp ->getIterator ();
12
+ $ iterator ->rewind ();
13
+
14
+ $ this ->assertSame ('Item1 ' , $ iterator ->current ()->text ());
15
+ $ iterator ->next ();
16
+ $ this ->assertSame ('Item2 ' , $ iterator ->current ()->text ());
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments