From c50c89795e6afa7d0c208e020ed12279e478e876 Mon Sep 17 00:00:00 2001 From: Igor Peisakhovich Date: Tue, 25 Nov 2025 13:07:14 +0200 Subject: [PATCH 1/3] PHP 8.4 compatibility: deprecated usage of an implicitly nullable parameter type - fixed --- src/PHPHtmlParser/Contracts/DomInterface.php | 2 +- src/PHPHtmlParser/Dom.php | 2 +- src/PHPHtmlParser/StaticDom.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PHPHtmlParser/Contracts/DomInterface.php b/src/PHPHtmlParser/Contracts/DomInterface.php index f259c9d1..2103ba30 100644 --- a/src/PHPHtmlParser/Contracts/DomInterface.php +++ b/src/PHPHtmlParser/Contracts/DomInterface.php @@ -19,5 +19,5 @@ public function loadStr(string $str, ?Options $options = null): Dom; public function setOptions(Options $options): Dom; - public function find(string $selector, int $nth = null); + public function find(string $selector, ?int $nth = null); } diff --git a/src/PHPHtmlParser/Dom.php b/src/PHPHtmlParser/Dom.php index 816b1b3b..89e46361 100755 --- a/src/PHPHtmlParser/Dom.php +++ b/src/PHPHtmlParser/Dom.php @@ -180,7 +180,7 @@ public function setOptions(Options $options): Dom * * @return mixed|Collection|null */ - public function find(string $selector, int $nth = null) + public function find(string $selector, ?int $nth = null) { $this->isLoaded(); diff --git a/src/PHPHtmlParser/StaticDom.php b/src/PHPHtmlParser/StaticDom.php index 78950204..fbd9861e 100755 --- a/src/PHPHtmlParser/StaticDom.php +++ b/src/PHPHtmlParser/StaticDom.php @@ -81,7 +81,7 @@ public static function loadFromFile(string $file, ?Options $options = null): Dom * @throws StrictException * @throws \Psr\Http\Client\ClientExceptionInterface */ - public static function loadFromUrl(string $url, ?Options $options = null, ClientInterface $client = null, RequestInterface $request = null): Dom + public static function loadFromUrl(string $url, ?Options $options = null, ?ClientInterface $client = null, ?RequestInterface $request = null): Dom { $dom = new Dom(); self::$dom = $dom; From 426366eace2064e9adfc01388c7bd1ed905c2549 Mon Sep 17 00:00:00 2001 From: Igor Peisakhovich Date: Sun, 30 Nov 2025 10:10:50 +0200 Subject: [PATCH 2/3] Update README.md (PHP 8.4 compatibility) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6889b079..7cdc5033 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Install the latest version using composer. $ composer require paquettg/php-html-parser ``` -This package can be found on [packagist](https://packagist.org/packages/paquettg/php-html-parser) and is best loaded using [composer](http://getcomposer.org/). We support php 7.2, 7.3, and 7.4. +This package can be found on [packagist](https://packagist.org/packages/paquettg/php-html-parser) and is best loaded using [composer](http://getcomposer.org/). We support PHP 7.2, 7.3, and 7.4. Also, it is supposed to be PHP 8.4 compatible. Basic Usage ----- From 7a5c53749c9b1a8bea57aacb55a2bf938930ada9 Mon Sep 17 00:00:00 2001 From: shmaya-alhazov Date: Sun, 30 Nov 2025 21:26:36 +0200 Subject: [PATCH 3/3] Add Packagist support: improved composer.json, README updates, and FUNDING.yml --- .github/FUNDING.yml | 2 +- README.md | 5 +++-- composer.json | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 8fe59770..02556665 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -4,7 +4,7 @@ # patreon: # Replace with a single Patreon username # open_collective: # Replace with a single Open Collective username # ko_fi: # Replace with a single Ko-fi username -tidelift: "packagist/paquettg/php-html-parser" +tidelift: "packagist/igor-krein/php-html-parser" # community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry # liberapay: # Replace with a single Liberapay username # issuehunt: # Replace with a single IssueHunt username diff --git a/README.md b/README.md index 7cdc5033..590f0499 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ PHP Html Parser ========================== +This is a fork of the original [PHP Html Parser] with only updated dependencies. The original package is no longer maintained. [![Build Status](https://travis-ci.org/paquettg/php-html-parser.png)](https://travis-ci.org/paquettg/php-html-parser) [![Coverage Status](https://coveralls.io/repos/paquettg/php-html-parser/badge.png)](https://coveralls.io/r/paquettg/php-html-parser) @@ -13,10 +14,10 @@ Install Install the latest version using composer. ```bash -$ composer require paquettg/php-html-parser +$ composer require igor-krein/php-html-parser ``` -This package can be found on [packagist](https://packagist.org/packages/paquettg/php-html-parser) and is best loaded using [composer](http://getcomposer.org/). We support PHP 7.2, 7.3, and 7.4. Also, it is supposed to be PHP 8.4 compatible. +This package can be found on [packagist](https://packagist.org/packages/igor-krein/php-html-parser) and is best loaded using [composer](http://getcomposer.org/). We support PHP 7.2, 7.3, and 7.4. Also, it is supposed to be PHP 8.4 compatible. Basic Usage ----- diff --git a/composer.json b/composer.json index 5d1eb185..df875a69 100755 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { - "name": "paquettg/php-html-parser", + "name": "igor-krein/php-html-parser", "type": "library", "description": "An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.", "keywords": ["html", "dom", "parser"], - "homepage": "https://github.com/paquettg/php-html-parser", + "homepage": "https://github.com/igor-krein/php-html-parser", "license": "MIT", "authors": [ {