Skip to content

Commit f83929a

Browse files
Add ReturnTypeWillChange attribute to offsetGet
Added the #[ReturnTypeWillChange] attribute to the offsetGet method in Collection to ensure compatibility with future PHP versions and suppress deprecation warnings. https: //github.com/paquettg/pull/291 https: //github.com/paquettg/issues/290 Co-Authored-By: David Young <6652430+davidbyoung@users.noreply.github.com>
1 parent 0098825 commit f83929a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PHPHtmlParser/Dom/Node/Collection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Countable;
1010
use IteratorAggregate;
1111
use PHPHtmlParser\Exceptions\EmptyCollectionException;
12+
use ReturnTypeWillChange;
1213

1314
use function call_user_func_array;
1415
use function count;
@@ -133,6 +134,7 @@ public function offsetUnset($offset): void
133134
*
134135
* @param mixed $offset
135136
*/
137+
#[ReturnTypeWillChange]
136138
public function offsetGet($offset): mixed
137139
{
138140
return $this->collection[$offset] ?? null;

0 commit comments

Comments
 (0)