Skip to content

Conversation

@jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Feb 23, 2025

Mostly interested in jtojnar@f14428e, hoping it would fix j0k3r/graby#359 but apparently it does not, it only gets rid of a warning.

@jtojnar jtojnar force-pushed the backports branch 3 times, most recently from dccd267 to 81ae5ca Compare February 23, 2025 00:25
This is deprecated since PHP 8.2:

    Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead

It was used because `DOMDocument`, which uses libxml2 internally, will parse the HTML as ISO-8859-1, unless the document contains an XML encoding declaration or HTML meta tag setting character set.
Since first such element wins, putting the `meta[charset]` up front will ensure the parser uses the correct encoding, even if the document contains incorrect meta tag (e.g. when the document is converted to UTF-8 without also updating the metadata by the software passing it to Readability).

https://stackoverflow.com/a/39148511/160386

(cherry picked from commit f14428e)
Mostly just of nodejs bump:

- https://github.com/actions/checkout/releases/tag/v4.0.0
- https://github.com/ramsey/composer-install/releases/tag/3.0.0

(cherry picked from commit 7f4c6cf, resolving conflicts with previous bump in 82083c8)
Composer v1 is not compatible with PHP 8.4.

master switched in 66215a6.
@jtojnar jtojnar force-pushed the backports branch 3 times, most recently from 0f6eb07 to 30d4649 Compare February 23, 2025 01:10
phpunit-bridge will create a symlink.

(cherry picked from commit 2c6c6d5)
It should no longer be necessary and PHPUnit 7.5 is not compatible with PHP 8.4.

master did that in 66215a6.
(cherry picked from commit c5407ec, except for rector)
Once we bump minimum PHP version, we will get newer PHP-CS-Fixer,
which will try to apply this cleanups.

(partially cherry picked from commit 648d8c6)

Though avoid disabling `modernize_strpos` since it was only introduced in PHP-CS-Fixer 3.2.0:
PHP-CS-Fixer/PHP-CS-Fixer@2ca22a2

Also had to disable `visibility_required` for constants since those require PHP ≥ 7.1:
https://cs.symfony.com/doc/rules/class_notation/visibility_required.html

And remove type hint from `grabArticle` since implicitly nullable types were deprecated in PHP 8.4:
https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
But we cannot use explicitly nullable types, which require PHP ≥ 7.1:
https://wiki.php.net/rfc/nullable_types

Also switch code blocks to Markdown syntax to work around `phpdoc_separation`, ApiGen uses Markdown these days anyway.
(partially cherry picked from commit 9ed89bd)
It will be deprecated in PHP 8.4 and it is meaningless nowadays anyway:
https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant

The use of the constant was introduced in 175196d.

(cherry picked from commit c7b10dc)
It is unused and would cause an error on PHP ≥ 8.0:
https://www.php.net/manual/en/function.set-error-handler.php#refsect1-function.set-error-handler-parameters

Not sure if the handler is even necessary – it was introduced in 175196d but I did not manage to reproduce the original error (Entity 'nbsp' not defined). It was probably fixed by f2a43b4.

(based on commit da75501)
- 8.1 was introduced in 66215a6
- 8.2 and 8.3 was introduced in 9bdd3b6
- 8.4 cherry picked from commit 5b9551d
@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 24, 2025

@j0k3r This should be ready now as well.

This is required for PHP 8.4 support.

On master this was done in 66215a6 and 1ac761d.
This allows developer to create their own own config file, e.g. for setting `editorUrl`:
https://phpstan.org/user-guide/output-format#opening-file-in-an-editor

(cherry picked from commit 1d7cdf3)
@j0k3r j0k3r merged commit 487ce3a into j0k3r:1.x Feb 24, 2025
15 checks passed
@jtojnar jtojnar deleted the backports branch February 24, 2025 08:54
@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 24, 2025

Could you please also create a new release to get rid of the warning on PHP 8.2? (6f44040)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants