Skip to content

Add #[\ReturnTypeWillChange] attribute for php8 compatibility #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "halilim/xml-iterator",
"name": "glsv/xml-iterator",
"type": "library",
"description": "XML Reader to simplexml/array iterator with low memory usage and an acceptable level of ease of use.",
"keywords": [
Expand Down Expand Up @@ -44,7 +44,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "develop"
}
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions src/Utf8Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Utf8Filter extends php_user_filter
*
* @link http://stackoverflow.com/a/3466609/372654
*/
#[\ReturnTypeWillChange]
public function filter($in, $out, &$consumed, $closing)
{
while ($bucket = stream_bucket_make_writeable($in)) {
Expand Down
5 changes: 5 additions & 0 deletions src/XmlIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public function __construct(
* @link http://stackoverflow.com/a/1835324/372654
* @return false|array|\SimpleXMLElement
*/
#[\ReturnTypeWillChange]
public function current()
{
$node = $this->reader->expand();
Expand Down Expand Up @@ -121,6 +122,7 @@ public function current()
* @link http://php.net/manual/en/iterator.next.php
* @return void Any returned value is ignored.
*/
#[\ReturnTypeWillChange]
public function next()
{
if ($this->reader->next($this->delimiterTagName)) {
Expand All @@ -133,6 +135,7 @@ public function next()
* @link http://php.net/manual/en/iterator.key.php
* @return int scalar on success, or null on failure.
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->position;
Expand All @@ -144,6 +147,7 @@ public function key()
* @return boolean The return value will be casted to boolean and then evaluated.
* Returns true on success or false on failure.
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->reader->name === $this->delimiterTagName;
Expand All @@ -155,6 +159,7 @@ public function valid()
* @throws \Exception
* @return void Any returned value is ignored.
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$uri = $this->xmlFileUri;
Expand Down