Skip to content

Symfony 7 and phpBB 4 compatibility#190

Merged
iMattPro merged 6 commits intophpbb-extensions:masterfrom
iMattPro:compatibility
Feb 14, 2026
Merged

Symfony 7 and phpBB 4 compatibility#190
iMattPro merged 6 commits intophpbb-extensions:masterfrom
iMattPro:compatibility

Conversation

@iMattPro
Copy link
Contributor

@iMattPro iMattPro commented Jan 2, 2026

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2026

Codecov Report

❌ Patch coverage is 67.44186% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.00%. Comparing base (be9d879) to head (5029457).

Files with missing lines Patch % Lines
routing/page_loader_phpbb4.php 0.00% 13 Missing ⚠️
routing/page_loader.php 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #190      +/-   ##
============================================
- Coverage     60.20%   60.00%   -0.21%     
- Complexity      214      224      +10     
============================================
  Files            15       18       +3     
  Lines           789      815      +26     
============================================
+ Hits            475      489      +14     
- Misses          314      326      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iMattPro iMattPro marked this pull request as draft January 3, 2026 15:39
@iMattPro iMattPro marked this pull request as ready for review January 13, 2026 02:00
@iMattPro iMattPro requested a review from Copilot January 13, 2026 02:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds compatibility for Symfony 7 and phpBB 4 by refactoring the page loader routing system. The implementation uses reflection to detect the Symfony version at runtime and delegates to version-specific adapters, ensuring the extension works across Symfony 3-7 and phpBB 3-4.

Changes:

  • Extracted core routing logic into a reusable page_loader_core class
  • Created version-specific adapters (page_loader_phpbb3 and page_loader_phpbb4) with appropriate type hints for their respective PHP/Symfony versions
  • Implemented runtime version detection in page_loader.php using reflection to determine which adapter to use

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
routing/page_loader_core.php New file containing extracted core logic for loading routes from the database
routing/page_loader_phpbb3.php New adapter for phpBB 3 / Symfony 3-6 with legacy-compatible type hints
routing/page_loader_phpbb4.php New adapter for phpBB 4 / Symfony 7 with strict type declarations and modern PHP syntax
routing/page_loader.php Refactored to use reflection-based version detection and delegate to appropriate adapter

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

Copy link

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 5 comments.


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

*
* @api
*/
public function load($resource, $type = null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could just return type be added instead? That should work for both load() declarations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is the type hinting is in the arguments, which must match, but is not compatible then with phpBB3, and if its not hinted and matching, then its not compatible with phpBB4, so wee need the separate versions.

It's:

public function load($resource, $type = null)

versus:

public function load(mixed $resource, ?string $type = null): RouteCollection

@rxu
Copy link
Contributor

rxu commented Feb 14, 2026

Okay, now when the extension is 4.0.0-a1 compatible, ext.php prevents from enabling it on phpBB4:

	public function is_enableable()
	{
		return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=')
			&& phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<');
	}

Also, fa-external-link-square is not longer rendered (next to the View page link) because doesn't exist in FA6 and should be replaced probably with fa-solid fa-square-arrow-up-right icon.

@iMattPro
Copy link
Contributor Author

Okay, now when the extension is 4.0.0-a1 compatible, ext.php prevents from enabling it on phpBB4:

	public function is_enableable()

	{

		return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=')

			&& phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<');

	}

Also, fa-external-link-square is not longer rendered (next to the View page link) because doesn't exist in FA6 and should be replaced probably with fa-solid fa-square-arrow-up-right icon.

Correct. This version is not for phpBB 4. There's a separate branch for that.

@iMattPro iMattPro merged commit 529bbdb into phpbb-extensions:master Feb 14, 2026
35 checks passed
@iMattPro iMattPro deleted the compatibility branch February 14, 2026 17:05
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.

3 participants