From 0ac08cafb23e955d5697bb23988c887a59e53dd6 Mon Sep 17 00:00:00 2001 From: Piotr Miazga Date: Fri, 2 Aug 2019 15:38:18 +0200 Subject: [PATCH] Hygiene: Simplify if statement and move comment It feels like the comment about history link time should be located next to the getHistoryLink function, not somewhere in the code. Statements like: if ( a ) { if ( b ) { // do sth; } } can be easily wrapped into: if ( a && b ) { // do sth } Change-Id: I98c071ecdd855210bc0a92f032ee622fb91e8df5 --- includes/skins/SkinMinerva.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index b68c7b6..d566104 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -479,6 +479,10 @@ class SkinMinerva extends SkinTemplate { * Prepare the content for the 'last edited' message, e.g. 'Last edited on 30 August * 2013, at 23:31'. This message is different for the main page since main page * content is typically transcluded rather than edited directly. + * + * The relative time is only rendered on the latest revision. + * For older revisions the last modified information will not render with a relative time + * nor will it show the name of the editor. * @param Title $title The Title object of the page being viewed * @return array */ @@ -614,15 +618,8 @@ class SkinMinerva extends SkinTemplate { $out->setPageTitle( $pageTitle ); } - if ( $this->canUseWikiPage() ) { - // If it's a page that exists, add last edited timestamp - // The relative time is only rendered on the latest revision. - // For older revisions the last modified - // information will not render with a relative time - // nor will it show the name of the editor. - if ( $this->getWikiPage()->exists() ) { - $tpl->set( 'historyLink', $this->getHistoryLink( $title ) ); - } + if ( $this->canUseWikiPage() && $this->getWikiPage()->exists() ) { + $tpl->set( 'historyLink', $this->getHistoryLink( $title ) ); } $tpl->set( 'headinghtml', $this->getHeadingHtml() );