diff --git a/includes/ButtonLinkWidget.php b/includes/ButtonLinkWidget.php index e323fe3..1a0a89f 100644 --- a/includes/ButtonLinkWidget.php +++ b/includes/ButtonLinkWidget.php @@ -1,19 +1,20 @@ getOutput(); $out->addModules([ "oojs-ui-core" diff --git a/includes/CreatePageWidget.php b/includes/CreatePageWidget.php index 496f5f1..ead4de9 100644 --- a/includes/CreatePageWidget.php +++ b/includes/CreatePageWidget.php @@ -1,6 +1,10 @@ 'nowiki']; } - public static function create($text, $params, \Parser $parser, \PPFrame $frame) { + public static function create($text, $params, Parser $parser, PPFrame $frame) { $config = MediaWikiServices::getInstance()->getMainConfig(); $configCreatePageNamespaces = $config->get('IsekaiCreatePageNamespaces'); diff --git a/includes/DiscoverWidget.php b/includes/DiscoverWidget.php index 56b554f..09cb132 100644 --- a/includes/DiscoverWidget.php +++ b/includes/DiscoverWidget.php @@ -1,6 +1,9 @@ 'nowiki']; } - public static function create($text, $params, \Parser $parser, \PPFrame $frame) { + public static function create($text, $params, Parser $parser, PPFrame $frame) { $parser->getOutput()->addModules(['ext.isekai.discover']); return self::getHtml(); diff --git a/includes/ExtraFontWidget.php b/includes/ExtraFontWidget.php index d0ef960..3f32393 100644 --- a/includes/ExtraFontWidget.php +++ b/includes/ExtraFontWidget.php @@ -1,11 +1,12 @@ extIsekaiWidgetsCache->get('extraFonts', INF, []); $content = $text = $parser->recursiveTagParseFully($text, $frame); diff --git a/includes/FeedListWidget.php b/includes/FeedListWidget.php index 55e119c..3c7ffa2 100644 --- a/includes/FeedListWidget.php +++ b/includes/FeedListWidget.php @@ -1,6 +1,11 @@ 'nowiki']; } - public static function create($text, $params, \Parser $parser, \PPFrame $frame) { + public static function create($text, $params, Parser $parser, PPFrame $frame) { $parser->getOutput()->addModules(['ext.isekai.feedList']); return self::getHtml(); diff --git a/includes/FontFaceWidget.php b/includes/FontFaceWidget.php index 2d1a410..796b614 100644 --- a/includes/FontFaceWidget.php +++ b/includes/FontFaceWidget.php @@ -1,7 +1,9 @@ ' . wfMessage('isekai-fontface-error-invalid-params')->parse() . ''; } diff --git a/includes/Html5Widget.php b/includes/Html5Widget.php index 20e45b0..30d7f6e 100644 --- a/includes/Html5Widget.php +++ b/includes/Html5Widget.php @@ -1,10 +1,12 @@ getOutput()->addModules(['ext.isekai.collapse']); $allowedAttr = ['class']; $htmlArgs = array_filter($args, function($k) use($allowedAttr) { @@ -19,7 +21,7 @@ class Html5Widget { return [Html::rawElement('details', $htmlArgs, $content), "markerType" => 'nowiki']; } - public static function createSummary(string $text, array $args, \Parser $parser, \PPFrame $frame) { + public static function createSummary(string $text, array $args, Parser $parser, PPFrame $frame) { $allowedAttr = ['class']; $htmlArgs = array_filter($args, function($k) use($allowedAttr) { return in_array($k, $allowedAttr); diff --git a/includes/InformationWidget.php b/includes/InformationWidget.php index eb6b4e9..a321795 100644 --- a/includes/InformationWidget.php +++ b/includes/InformationWidget.php @@ -1,8 +1,9 @@ 'nowiki']; } - public static function buildInfoBox(\Parser $parser, \PPFrame $frame, array $dataMap, $title, $picture, $float) { + public static function buildInfoBox(Parser $parser, PPFrame $frame, array $dataMap, $title, $picture, $float) { $parser->getOutput()->addModules(['ext.isekai.information.infobox']); $tableClasses = ['wikitable-container', 'infobox']; @@ -155,11 +156,11 @@ class InformationWidget { /** * @param string $content * @param array $args - * @param \Parser $parser - * @param \PPFrame $frame + * @param Parser $parser + * @param PPFrame $frame * @return array|string */ - public static function create(string $content, array $args, \Parser $parser, \PPFrame $frame) { + public static function create(string $content, array $args, Parser $parser, PPFrame $frame) { $configKeys = ['type', 'float', 'title_key', 'picture']; $configArgs = []; $infoArgs = []; diff --git a/includes/MasonryItemWidget.php b/includes/MasonryItemWidget.php index 79f7912..906810e 100644 --- a/includes/MasonryItemWidget.php +++ b/includes/MasonryItemWidget.php @@ -1,17 +1,19 @@ getOutput()->addModules(['ext.isekai.masonry']); $params['cols'] = intval($params['cols'] ?? 2); diff --git a/includes/Parsoid/VEvalTagHandler.php b/includes/Parsoid/VEvalTagHandler.php index f61f2f8..6d80067 100644 --- a/includes/Parsoid/VEvalTagHandler.php +++ b/includes/Parsoid/VEvalTagHandler.php @@ -39,7 +39,6 @@ class VEvalTagHandler extends ExtensionTagHandler { return $extApi->extTagToDOM( $extArgs, - '', $src, [ 'wrapperTag' => $wrapperTag, @@ -47,7 +46,7 @@ class VEvalTagHandler extends ExtensionTagHandler { 'extTag' => 'veval', 'context' => $contextType ], - ], - );; + ] + ); } } \ No newline at end of file diff --git a/includes/PreviewCardWidget.php b/includes/PreviewCardWidget.php index 33ac1f7..f22a44c 100644 --- a/includes/PreviewCardWidget.php +++ b/includes/PreviewCardWidget.php @@ -1,6 +1,9 @@ 'nowiki']; } - public static function create($text, $params, \Parser $parser, \PPFrame $frame) { + public static function create($text, $params, Parser $parser, PPFrame $frame) { $parser->getOutput()->addModules(['ext.isekai.previewCard']); $titleChunk = explode('/', $text); diff --git a/includes/PreviewPageListWidget.php b/includes/PreviewPageListWidget.php index 749cb33..2a8f3c6 100644 --- a/includes/PreviewPageListWidget.php +++ b/includes/PreviewPageListWidget.php @@ -3,11 +3,11 @@ namespace Isekai\Widgets; use ApiMain; use Exception; -use FauxRequest; -use Html; -use MediaWiki\Linker\LinkRenderer; -use MediaWiki\MediaWikiServices; -use Title; +use MediaWiki\Request\FauxRequest; +use MediaWiki\Title\Title; +use MediaWiki\Html\Html; +use MediaWiki\Parser\Parser; +use PPFrame; class PreviewPageListWidget { public const CONTAINER_CLASS_NAME = 'isekai-card isekai-preview-page-list-card'; @@ -41,7 +41,7 @@ class PreviewPageListWidget { Html::closeElement('div'); } - public static function create($text, $params, \Parser $parser, \PPFrame $frame) { + public static function create($text, $params, Parser $parser, PPFrame $frame) { $parser->getOutput()->addModules(['ext.isekai.previewPageList']); $loader = $params['loader'] ?? 'unknown'; diff --git a/includes/TileGroupWidget.php b/includes/TileGroupWidget.php index e5dc4ea..57fad14 100644 --- a/includes/TileGroupWidget.php +++ b/includes/TileGroupWidget.php @@ -2,7 +2,9 @@ namespace Isekai\Widgets; -use Html; +use MediaWiki\Parser\Parser; +use MediaWiki\Html\Html; +use PPFrame; class TileGroupWidget { private $content = ''; @@ -16,7 +18,7 @@ class TileGroupWidget { $this->parseArgs($args); } - public static function create(string $text, array $args, \Parser $parser, \PPFrame $frame) { + public static function create(string $text, array $args, Parser $parser, PPFrame $frame) { $content = $parser->recursiveTagParse($text, $frame); $args['content'] = $content; diff --git a/includes/TileWidget.php b/includes/TileWidget.php index 93fa541..1580452 100644 --- a/includes/TileWidget.php +++ b/includes/TileWidget.php @@ -2,9 +2,11 @@ namespace Isekai\Widgets; -use Html; +use MediaWiki\Title\Title; +use MediaWiki\Html\Html; +use MediaWiki\Parser\Parser; +use PPFrame; use MediaWiki\MediaWikiServices; -use Title; class TileWidget { private $size = 'medium'; @@ -25,7 +27,7 @@ class TileWidget { $this->parseArgs($args); } - public static function create(string $text, array $args, \Parser $parser, \PPFrame $frame) { + public static function create(string $text, array $args, Parser $parser, PPFrame $frame) { $parser->getOutput()->addModules(['ext.isekai.tile']); $content = ''; diff --git a/includes/Utils.php b/includes/Utils.php index 2f8257e..0c7cf86 100644 --- a/includes/Utils.php +++ b/includes/Utils.php @@ -1,6 +1,8 @@ recursiveTagParse($text, $frame); return [$content, "markerType" => 'nowiki']; } diff --git a/includes/Widgets.php b/includes/Widgets.php index f9bc027..b2a8e92 100644 --- a/includes/Widgets.php +++ b/includes/Widgets.php @@ -3,7 +3,8 @@ namespace Isekai\Widgets; use MapCacheLRU; use MediaWiki\MediaWikiServices; -use Parser; +use MediaWiki\Parser\Parser; +use MediaWiki\Output\OutputPage; class Widgets { /** @@ -40,7 +41,7 @@ class Widgets { return true; } - public static function onLoad(\OutputPage $outputPage) { + public static function onLoad(OutputPage $outputPage) { $outputPage->addModuleStyles([ "ext.isekai.widgets.global", "ext.isekai.information.infobox",