Skip to content

[ticket/17672] Fix php 8.2 and symfony 7.4 deprecations#6973

Open
rubencm wants to merge 11 commits into
phpbb:masterfrom
rubencm:ticket/17672
Open

[ticket/17672] Fix php 8.2 and symfony 7.4 deprecations#6973
rubencm wants to merge 11 commits into
phpbb:masterfrom
rubencm:ticket/17672

Conversation

@rubencm

@rubencm rubencm commented Jun 28, 2026

Copy link
Copy Markdown
Member

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17672

@rubencm rubencm force-pushed the ticket/17672 branch 2 times, most recently from f6e9d13 to 02517b7 Compare June 28, 2026 17:04
@rubencm rubencm marked this pull request as draft July 7, 2026 19:04
rubencm added 9 commits July 7, 2026 21:27
utf8_encode() was deprecated in PHP 8.2 and will be removed in PHP 9.0.
Replace all 6 calls in recode_basic.php with mb_convert_encoding().

Affected functions: iso_8859_1(), iso_8859_8(), iso_8859_9(),
iso_8859_15(), cp1252(), cp1254()

PHPBB-17672
HttpKernel\DependencyInjection\Extension was marked @internal since
Symfony 7.1. Replace with DependencyInjection\Extension\Extension.
Add : void return type to load() overrides to match ExtensionInterface.

PHPBB-17672
getArguments() was removed from ControllerResolverInterface in Symfony
5.0. Add argument_resolver implementing ArgumentResolverInterface with
phpBB type-casting security logic and register it in services_http.yml.

PHPBB-17672
Add explicit void return type to phpBB CompilerPassInterface
implementations: collection_pass and markpublic_pass.

PHPBB-17672
Update tests in controller_test.php to expect TypeError instead of
ReflectionException when invalid callable arguments are passed to the
typehinted getArguments() method.

PHPBB-17672
Run phpcbf on phpBB/phpbb to auto-fix code layout and style violations,
including uppercase NULL constants and trailing empty lines.

PHPBB-17672
Update the expected exception message in extension_controller_test to
match the format produced by phpBB's custom argument_resolver.

PHPBB-17672
@rubencm rubencm marked this pull request as ready for review July 7, 2026 19:49
@rubencm rubencm requested a review from Copilot July 7, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates phpBB to avoid deprecations and behavior changes introduced by PHP 8.2 and Symfony 7.4, primarily by adjusting test helpers/mocks/reflection usage and aligning core integrations (HttpKernel argument resolution, Console command registration, config tree building) with Symfony 7.4 APIs.

Changes:

  • Introduces a dedicated phpbb\controller\argument_resolver and wires it into Symfony’s HttpKernel, removing argument resolution from the controller resolver.
  • Updates tests and console-related wiring to match Symfony 7.4 expectations (e.g., Application::addCommand(), updated controller error messages, removing deprecated reflection setAccessible() calls).
  • Replaces deprecated PHP functions/usages (e.g., utf8_encode) and fixes/modernizes various docblocks and type signatures.

Reviewed changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/path_helper/path_helper_test.php Updates mock method list to reflect current phpbb\symfony_request usage.
tests/notification/manager_mark_by_id_test.php Removes deprecated reflection setAccessible() usage in test.
tests/migrator/revert_data_merge_test.php Removes deprecated reflection setAccessible() usage in test.
tests/functional/fixtures/ext/foo/foo/event/template_event_order.php Adds return type to getSubscribedEvents() for Symfony subscriber signature compatibility.
tests/functional/fixtures/ext/foo/foo/event/template_event_order_lower.php Adds return type to getSubscribedEvents() for Symfony subscriber signature compatibility.
tests/functional/fixtures/ext/foo/bar/event/user_setup.php Adds return type to getSubscribedEvents() for Symfony subscriber signature compatibility.
tests/functional/fixtures/ext/foo/bar/event/template_event_order.php Adds return type to getSubscribedEvents() for Symfony subscriber signature compatibility.
tests/functional/fixtures/ext/foo/bar/event/template_event_order_higher.php Adds return type to getSubscribedEvents() for Symfony subscriber signature compatibility.
tests/functional/fixtures/ext/foo/bar/event/permission.php Adds return type to getSubscribedEvents() for Symfony subscriber signature compatibility.
tests/functional/extension_controller_test.php Updates expected exception text emitted by controller argument resolution.
tests/download/download_allowed_test.php Removes deprecated reflection setAccessible() usage in test.
tests/controller/controller_test.php Switches controller argument resolution tests to use the new argument_resolver and updates expected failures.
tests/console/user/reclean_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/user/delete_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/user/delete_ids_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/user/add_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/user/activate_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/update/check_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/thumbnail_test.php Uses Application::addCommand() for thumbnail console command registration.
tests/console/searchindex/list_all_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/searchindex/delete_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/searchindex/create_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/cron/run_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/cron/cron_list_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/config/config_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/console/cache/purge_test.php Uses Application::addCommand() per Symfony Console 7.4 API changes.
tests/auth/provider_oauth_token_storage_test.php Removes deprecated reflection setAccessible() usage in test.
phpBB/phpbb/version_helper.php Fixes sorting callback to use three-way compare instead of boolean comparison.
phpBB/phpbb/template/twig/node/includenode.php Docblock cleanup: correct parameter naming/type hinting.
phpBB/phpbb/template/twig/node/includeasset.php Docblock cleanup: correct parameter naming/type hinting.
phpBB/phpbb/template/twig/node/event.php Docblock cleanup: correct parameter naming/type hinting.
phpBB/phpbb/template/twig/node/definenode.php Docblock cleanup: correct parameter naming/type hinting.
phpBB/phpbb/template/twig/extension/routing.php Docblock tag reordering (author tag positioning) for consistency.
phpBB/phpbb/passwords/driver/salted_md5.php Docblock metadata cleanup for the embedded hashing framework header.
phpBB/phpbb/install/installer_configuration.php Removes isRequired() calls where defaults are provided (Symfony Config deprecation alignment).
phpBB/phpbb/install/console/command/update/update.php Adds : void return type to configure() to match Symfony Console signatures.
phpBB/phpbb/install/console/command/update/config/validate.php Adds : void return type to configure() to match Symfony Console signatures.
phpBB/phpbb/install/console/command/update/config/show.php Adds : void return type to configure() to match Symfony Console signatures.
phpBB/phpbb/install/console/command/install/install.php Adds : void return type to configure() to match Symfony Console signatures.
phpBB/phpbb/install/console/command/install/config/validate.php Adds : void return type to configure() to match Symfony Console signatures.
phpBB/phpbb/install/console/command/install/config/show.php Adds : void return type to configure() to match Symfony Console signatures.
phpBB/phpbb/extension/di/extension_base.php Adjusts imports and return typing to avoid Symfony type/deprecation issues.
phpBB/phpbb/exception/runtime_exception.php Replaces \Exception with \Throwable for chaining compatibility and modern PHP typing.
phpBB/phpbb/exception/http_exception.php Replaces \Exception with \Throwable for chaining compatibility and modern PHP typing.
phpBB/phpbb/di/pass/markpublic_pass.php Adds : void return type to compiler pass process() method.
phpBB/phpbb/di/pass/collection_pass.php Adds : void return type to compiler pass process() method.
phpBB/phpbb/di/extension/core.php Adjusts imports and return typing to avoid Symfony type/deprecation issues.
phpBB/phpbb/db/tools/doctrine.php Docblock parameter name fix for clarity and tooling.
phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php Normalizes NULL to null in schema arrays (PHP 8.2 compatibility/style).
phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php Normalizes NULL to null in schema arrays (PHP 8.2 compatibility/style).
phpBB/phpbb/db/driver/driver.php Fixes a switch case label terminator typo for query building.
phpBB/phpbb/controller/resolver.php Removes argument resolution from controller resolver (to be handled by dedicated argument resolver).
phpBB/phpbb/controller/argument_resolver.php New Symfony ArgumentResolverInterface implementation applying phpBB string type-casting for URL attributes.
phpBB/phpbb/console/application.php Uses addCommand() when registering commands from the container.
phpBB/phpbb/composer/installer.php Removes deprecated reflection setAccessible() usage when reading repository URL.
phpBB/phpbb/avatar/manager.php Docblock parameter naming fix for clarity and tooling.
phpBB/includes/utf/data/recode_basic.php Replaces deprecated utf8_encode() with mb_convert_encoding() based conversions.
phpBB/includes/diff/diff.php Docblock @since cleanup.
phpBB/includes/acp/acp_permissions.php Docblock type order correction for property annotation.
phpBB/config/default/container/services_http.yml Wires the new controller argument resolver into the http_kernel service definition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread phpBB/phpbb/controller/argument_resolver.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 62 out of 62 changed files in this pull request and generated no new comments.

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