diff --git a/includes/SkinTimeless.php b/includes/SkinTimeless.php index d216fde..e1de6a1 100644 --- a/includes/SkinTimeless.php +++ b/includes/SkinTimeless.php @@ -1,4 +1,9 @@ 'mw-portlet', 'id' => 'p-search' ] ); + $html = Html::openElement( 'div', [ 'class' => 'mw-portlet', 'id' => 'p-search' ] ); $html .= Html::rawElement( 'h3', @@ -580,9 +588,7 @@ class TimelessTemplate extends BaseTemplate { ) ); - $html .= Html::closeElement( 'div' ); - - return $html; + return $html . Html::closeElement( 'div' ); } /** @@ -608,9 +614,7 @@ class TimelessTemplate extends BaseTemplate { $html .= $this->getPortlet( $name, $content ); } - $html = $this->getSidebarChunk( 'site-navigation', 'navigation', $html ); - - return $html; + return $this->getSidebarChunk( 'site-navigation', 'navigation', $html ); } /** @@ -649,9 +653,8 @@ class TimelessTemplate extends BaseTemplate { * @return string html */ protected function getPageToolSidebar() { - $pageTools = ''; // @phan-suppress-next-line SecurityCheck-DoubleEscaped - $pageTools .= $this->getPortlet( + $pageTools = $this->getPortlet( 'cactions', $this->pileOfTools['page-secondary'], 'timeless-pageactions' @@ -690,7 +693,6 @@ class TimelessTemplate extends BaseTemplate { // Preserve standard username label to allow customisation (T215822) $userName = $personalTools['userpage']['links'][0]['text'] ?? $user->getName(); - $html = ''; $extraTools = []; // Remove anon placeholder @@ -725,7 +727,7 @@ class TimelessTemplate extends BaseTemplate { $dropdownHeader = $this->getMsg( 'timeless-anonymous' )->text(); $headerMsg = 'timeless-notloggedin'; } - $html .= Html::openElement( 'div', [ 'id' => 'user-tools' ] ); + $html = Html::openElement( 'div', [ 'id' => 'user-tools' ] ); $html .= Html::rawElement( 'div', [ 'id' => 'personal' ], Html::rawElement( 'h2', [], @@ -782,18 +784,14 @@ class TimelessTemplate extends BaseTemplate { * @return string html */ protected function getContentSub() { - $html = ''; - - $html .= Html::openElement( 'div', [ 'id' => 'contentSub' ] ); + $html = Html::openElement( 'div', [ 'id' => 'contentSub' ] ); if ( $this->data['subtitle'] ) { $html .= $this->get( 'subtitle' ); } if ( $this->data['undelete'] ) { $html .= $this->get( 'undelete' ); } - $html .= Html::closeElement( 'div' ); - - return $html; + return $html . Html::closeElement( 'div' ); } /** @@ -899,8 +897,6 @@ class TimelessTemplate extends BaseTemplate { // This is really dumb, and you're an idiot for doing it this way. // Obviously if you're not the idiot who did this, I don't mean you. foreach ( $pileOfEditTools as $navKey => $navBlock ) { - $currentSet = null; - if ( in_array( $navKey, [ 'watch', 'unwatch' @@ -995,7 +991,6 @@ class TimelessTemplate extends BaseTemplate { $skin = $this->getSkin(); $catHeader = 'categories'; $catList = ''; - $html = ''; $allCats = $skin->getOutput()->getCategoryLinks(); if ( !empty( $allCats ) ) { @@ -1032,10 +1027,10 @@ class TimelessTemplate extends BaseTemplate { } if ( $catList !== '' ) { - $html = $this->getSidebarChunk( 'catlinks-sidebar', $catHeader, $catList ); + return $this->getSidebarChunk( 'catlinks-sidebar', $catHeader, $catList ); } - return $html; + return ''; } /** @@ -1065,9 +1060,7 @@ class TimelessTemplate extends BaseTemplate { // @phan-suppress-next-line SecurityCheck-DoubleEscaped $html .= $this->getPortlet( $id, $categoriesHtml, $message ); - $html .= Html::closeElement( 'div' ); - - return $html; + return $html . Html::closeElement( 'div' ); } /** diff --git a/includes/TimelessVariablesModule.php b/includes/TimelessVariablesModule.php index 8e38c0b..d0972b8 100644 --- a/includes/TimelessVariablesModule.php +++ b/includes/TimelessVariablesModule.php @@ -1,4 +1,10 @@