fix: import Html\Html for 1.44#42
Conversation
📝 WalkthroughWalkthroughThe extension version was updated to 3.0.0 with a raised minimum MediaWiki requirement. The CI workflow matrix was adjusted by removing older MediaWiki/PHP combinations and adding a new one for REL1_44 with PHP 8.3. The Html import in HumanizingHtmlFormatter was changed to a fully qualified namespace. Changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Services/HumanizingHtmlFormatter.php (2)
78-84: Parameter$Htmlshadows theHtmlclass and breaks camel-case conventionsUsing an upper-case
$Htmlvariable invites confusion with the importedHtmlclass and violates PSR naming style. Rename the parameter to$html(lower-case) and adjust its usages.-private function warpInEdtfDiv( string $Html ): string { +private function warpInEdtfDiv( string $html ): string { return Html::rawElement( 'div', [ 'class' => 'edtf-value' ], - $Html + $html ); }
25-32: Add explicit return type toformatfor stricter contracts
ValueFormatter::formatis expected to return astring(per the common interface in ValueFormatters). Declaring the return type here tightens static analysis and prevents accidental mistakes.- public function format( $edtf ) { + public function format( $edtf ): string {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Services/HumanizingHtmlFormatter.php(1 hunks)
🔇 Additional comments (1)
src/Services/HumanizingHtmlFormatter.php (1)
13-13: Import update aligns with MW 1.44 namespace – looks goodSwitching to
MediaWiki\Html\Htmlis required as of MW 1.44 and prevents autoloader failures at runtime.
|
What is the min MW version needed for this? |
The |
|
Let's do a release before we raise min MW version to 1.40 |
|
I'll do that now |
|
Done. Tagged 2.1.2 @rti please update https://github.com/ProfessionalWiki/WikibaseEdtf/blob/master/.github/workflows/ci.yml#L19-L32 by removing MW < 1.40 and adding 1.44. Also update |
|
@JeroenDeDauw done |
Fix import MediaWiki\Html\Html for MediaWiki 1.44.
https://phabricator.wikimedia.org/T166010
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1120610/5/includes/Html/Html.php
Summary by CodeRabbit