Symfony 7 and phpBB 4 compatibility#190
Conversation
b2c11e3 to
704fb46
Compare
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
704fb46 to
2a229a1
Compare
There was a problem hiding this comment.
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_coreclass - Created version-specific adapters (
page_loader_phpbb3andpage_loader_phpbb4) with appropriate type hints for their respective PHP/Symfony versions - Implemented runtime version detection in
page_loader.phpusing 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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Could just return type be added instead? That should work for both load() declarations.
There was a problem hiding this comment.
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
|
Okay, now when the extension is 4.0.0-a1 compatible, public function is_enableable()
{
return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=')
&& phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<');
}Also, |
Correct. This version is not for phpBB 4. There's a separate branch for that. |
No description provided.