From bb7392f5beaff7a2306dc7b4b143ca73cece743d Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Mon, 31 Mar 2025 22:48:28 -0400 Subject: [PATCH 1/3] Add nullable attribute for parameters with null defaults for PHP 8.4 --- src/voku/helper/SimpleHtmlAttributes.php | 2 +- src/voku/helper/SimpleHtmlAttributesInterface.php | 2 +- src/voku/helper/XmlDomParser.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/voku/helper/SimpleHtmlAttributes.php b/src/voku/helper/SimpleHtmlAttributes.php index c52c102..4d2eb35 100644 --- a/src/voku/helper/SimpleHtmlAttributes.php +++ b/src/voku/helper/SimpleHtmlAttributes.php @@ -184,7 +184,7 @@ public function replace(string $old, string $new) /** * {@inheritdoc} */ - public function toggle(string $token, bool $force = null): bool + public function toggle(string $token, ?bool $force = null): bool { // init $this->tokenize(); diff --git a/src/voku/helper/SimpleHtmlAttributesInterface.php b/src/voku/helper/SimpleHtmlAttributesInterface.php index 106b7e4..26fe69c 100644 --- a/src/voku/helper/SimpleHtmlAttributesInterface.php +++ b/src/voku/helper/SimpleHtmlAttributesInterface.php @@ -78,5 +78,5 @@ public function replace(string $old, string $new); * @return bool false if the token is not in the list after the call, or true if the token is in the list after the * call */ - public function toggle(string $token, bool $force = null): bool; + public function toggle(string $token, ?bool $force = null): bool; } diff --git a/src/voku/helper/XmlDomParser.php b/src/voku/helper/XmlDomParser.php index 9bf16bb..dc4452a 100644 --- a/src/voku/helper/XmlDomParser.php +++ b/src/voku/helper/XmlDomParser.php @@ -634,7 +634,7 @@ public function loadXmlFile(string $filePath, $libXMLExtraOptions = null, $useDe * * @return void */ - public function replaceTextWithCallback($callback, \DOMNode $domNode = null) + public function replaceTextWithCallback($callback, ?\DOMNode $domNode = null) { if ($domNode === null) { $domNode = $this->document; From 09856953cb5dd570ba2d791c62c5a7be66faf667 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Mon, 31 Mar 2025 22:49:34 -0400 Subject: [PATCH 2/3] Require PHP 7.1 and allow PHPUnit 11 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4ea1415..51b1d24 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } ], "require": { - "php": ">=7.0.0", + "php": ">=7.1.0", "ext-dom": "*", "ext-libxml": "*", "ext-simplexml": "*", @@ -33,7 +33,7 @@ "voku/portable-utf8": "If you need e.g. UTF-8 fixed output." }, "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + "phpunit/phpunit": "~7.0 || ~9.0 || ~10.0 || ~11.0" }, "autoload": { "psr-4": { From f6b3341b90735f778d97cc03c7b3c7b68db611f6 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Mon, 31 Mar 2025 22:57:11 -0400 Subject: [PATCH 3/3] Update CI pipeline PHP versions and action versions --- .github/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a4ae9..872a568 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,19 +17,21 @@ jobs: fail-fast: false matrix: php: [ - 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, - 8.1 + 8.1, + 8.2, + 8.3, + 8.4 ] composer: [basic] timeout-minutes: 10 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@2.9.0 @@ -44,7 +46,7 @@ jobs: run: echo "::set-output name=directory::$(composer config cache-dir)" - name: Cache composer dependencies - uses: actions/cache@v2.1.3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.directory }} key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} @@ -88,7 +90,7 @@ jobs: uses: codecov/codecov-action@v1 with: files: build/logs/clover.xml - + - name: Archive logs artifacts if: ${{ failure() }} uses: actions/upload-artifact@v2