From 004e06d4fe859af678e27e37f1cdca8ce75405ca Mon Sep 17 00:00:00 2001 From: Maciej Brencz Date: Mon, 6 Jan 2025 21:48:42 +0000 Subject: [PATCH 1/3] php.yml: run tests under PHP 8.4 as well --- .github/workflows/php.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8b99450..c47af1e 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,7 +19,8 @@ jobs: php-versions: - '8.1' - '8.2' - - '8.3' # nightly + - '8.3' + - '8.4' steps: - uses: actions/checkout@v3 From 6953f3145f9e281292d0fa92778774262c44715d Mon Sep 17 00:00:00 2001 From: macbre Date: Mon, 13 Jan 2025 20:44:03 +0000 Subject: [PATCH 2/3] composer: require PHPUnit 11.5 or 10.3 --- composer.json | 2 +- composer.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index d598e55..657ebd5 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "php": "^8.1" }, "require-dev": { - "phpunit/phpunit": "^10.3", + "phpunit/phpunit": "^10.3 || ^11.5", "friendsofphp/php-cs-fixer": "^3.22" }, "scripts": { diff --git a/composer.lock b/composer.lock index f7c1029..14a53da 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "331567764171bde442b7efcdc3f90583", + "content-hash": "04e8d6e2022f043fa7e2a13e4bb0fcac", "packages": [], "packages-dev": [ { @@ -3578,13 +3578,13 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "ext-xml": "*", "php": "^8.1" }, - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } From 6eb5068492e219cc14dbca2398c0e1dda7a683ed Mon Sep 17 00:00:00 2001 From: macbre Date: Mon, 13 Jan 2025 21:14:08 +0000 Subject: [PATCH 3/3] XMLParser: resolve PHP 8.4 deprecations Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in xml-iterator/src/XMLParser.php on line 65 Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in xml-iterator/src/XMLParser.php on line 66 Deprecated: xml_set_character_data_handler(): Passing non-callable strings is deprecated since 8.4 in xml-iterator/src/XMLParser.php on line 67 ---- See https://github.com/php/php-src/commit/25b4696530c5dfad6b04a57c274200beec51ab0d --- src/XMLParser.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/XMLParser.php b/src/XMLParser.php index d9e92f3..3005b66 100644 --- a/src/XMLParser.php +++ b/src/XMLParser.php @@ -62,9 +62,8 @@ public function setUp(): void * Once the iterator goes through them all, the self::next() method * will read and parse the next portion of the input XML stream. */ - xml_set_object($this->parser, $this); - xml_set_element_handler($this->parser, 'startXML', 'endXML'); - xml_set_character_data_handler($this->parser, 'charXML'); + xml_set_element_handler($this->parser, [$this,'startXML'], [$this, 'endXML']); + xml_set_character_data_handler($this->parser, [$this,'charXML']); // @see https://www.php.net/manual/en/function.xml-parser-set-option.php xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);