Sort imports alphabetically in Main.php hook handler - #15
Merged
Conversation
Move OutputPage use statement into alphabetical order, fixing the CI composer test (phpcs) failure.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds resource file path mapping, updates the simple blog page fix resource module path and dependency name in ChangesExtension resource configuration and imports
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Two bugs surfaced by the REL1_45 CI leg's ResourcesTest structure tests: - The declared dependency 'ext.OOJSPlus.data' does not exist; the real OOJSPlus module name is 'ext.oOJSPlus.data' (lowercase o prefix). - The scripts path resolved against MediaWiki core's root instead of the extension directory. Declare ResourceFileModulePaths explicitly, matching the convention used by CreateWiki's extension.json, so the module resolves correctly regardless of implicit path defaulting.
The Miraheze CI test matrix that runs ResourcesTest doesn't include the OOJSPlus extension, so any hard 'dependencies' entry naming one of its modules fails testValidDependencies regardless of spelling. Since the JS shim only needs OOJSPlus.data by the time SimpleBlogPage's panel runs, drop the extension.json dependency and instead wait for the module with mw.loader.using() inside the script itself, which resolves correctly on wikis that actually have OOJSPlus installed and no-ops elsewhere.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change reorganizes the import statements in the Main hook handler file to follow alphabetical ordering conventions.
Summary
Reordered the
usestatements inincludes/HookHandlers/Main.phpto maintain consistent alphabetical ordering of imported classes.Key changes
MediaWiki\Output\OutputPageimport afterMediaWiki\MediaWikiServicesto maintain alphabetical order by namespace and class nameDetails
The imports are now sorted alphabetically:
MediaWiki\Html\HtmlMediaWiki\Http\HttpRequestFactoryMediaWiki\Linker\LinkerMediaWiki\MainConfigNamesMediaWiki\MediaWikiServicesMediaWiki\Output\OutputPage(moved)MediaWiki\Permissions\Hook\TitleReadWhitelistHookMediaWiki\Shell\ShellMediaWiki\SpecialPage\SpecialPageThis improves code maintainability and follows PSR-12 coding standards for import organization.
https://claude.ai/code/session_01NNc3hYc9gyZHhSmg7Azg3o
Summary by CodeRabbit