Merge "Update set of files cleaned up after parserTests"
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index 176fbd4..0587649 100644 (file)
  * @ingroup SpecialPage
  */
 class SpecialWhatLinksHere extends IncludableSpecialPage {
-
-       /**
-        * @var FormOptions
-        */
+       /** @var FormOptions */
        protected $opts;
 
        protected $selfTitle;
 
-       /**
-        * @var Title
-        */
+       /** @var Title */
        protected $target;
 
        protected $limits = array( 20, 50, 100, 250, 500 );
@@ -79,6 +74,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                $this->target = Title::newFromURL( $opts->getValue( 'target' ) );
                if ( !$this->target ) {
                        $out->addHTML( $this->whatlinkshereForm() );
+
                        return;
                }
 
@@ -88,7 +84,13 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                $out->setPageTitle( $this->msg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
                $out->addBacklinkSubtitle( $this->target );
-               $this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ), $opts->getValue( 'from' ), $opts->getValue( 'back' ) );
+               $this->showIndirectLinks(
+                       0,
+                       $this->target,
+                       $opts->getValue( 'limit' ),
+                       $opts->getValue( 'from' ),
+                       $opts->getValue( 'back' )
+               );
        }
 
        /**
@@ -158,7 +160,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        'rd_namespace' => $target->getNamespace(),
                        'rd_title' => $target->getDBkey(),
                        'rd_interwiki = ' . $dbr->addQuotes( '' ) . ' OR rd_interwiki IS NULL'
-               )));
+               ) ) );
 
                if ( $fetchlinks ) {
                        $options['ORDER BY'] = 'pl_from';
@@ -184,7 +186,10 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        );
                }
 
-               if ( ( !$fetchlinks || !$plRes->numRows() ) && ( $hidetrans || !$tlRes->numRows() ) && ( $hideimages || !$ilRes->numRows() ) ) {
+               if ( ( !$fetchlinks || !$plRes->numRows() )
+                       && ( $hidetrans || !$tlRes->numRows() )
+                       && ( $hideimages || !$ilRes->numRows() )
+               ) {
                        if ( 0 == $level ) {
                                if ( !$this->including() ) {
                                        $out->addHTML( $this->whatlinkshereForm() );
@@ -197,6 +202,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                                        $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
                                }
                        }
+
                        return;
                }
 
@@ -270,7 +276,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                $out->addHTML( $this->listEnd() );
 
                if ( $level == 0 ) {
-                       if( !$this->including() ){
+                       if ( !$this->including() ) {
                                $out->addHTML( $prevnext );
                        }
                }
@@ -321,12 +327,16 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                }
 
                if ( count( $props ) ) {
-                       $propsText = $this->msg( 'parentheses' )->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
+                       $propsText = $this->msg( 'parentheses' )
+                               ->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
                }
 
                # Space for utilities links, with a what-links-here link provided
                $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
-               $wlh = Xml::wrapClass( $this->msg( 'parentheses' )->rawParams( $wlhLink )->escaped(), 'mw-whatlinkshere-tools' );
+               $wlh = Xml::wrapClass(
+                       $this->msg( 'parentheses' )->rawParams( $wlhLink )->escaped(),
+                       'mw-whatlinkshere-tools'
+               );
 
                return $notClose ?
                        Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" :
@@ -414,7 +424,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                # Target input
                $f .= Xml::inputLabel( $this->msg( 'whatlinkshere-page' )->text(), 'target',
-                               'mw-whatlinkshere-target', 40, $target );
+                       'mw-whatlinkshere-target', 40, $target );
 
                $f .= ' ';
 
@@ -460,7 +470,8 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        $types[] = 'hideimages';
                }
 
-               // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans', 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
+               // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans',
+               // 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
                // To be sure they will be found by grep
                foreach ( $types as $type ) {
                        $chosen = $this->opts->getValue( $type );
@@ -469,7 +480,11 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        $links[] = $this->msg( "whatlinkshere-{$type}" )->rawParams(
                                $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) )->escaped();
                }
-               return Xml::fieldset( $this->msg( 'whatlinkshere-filters' )->text(), $this->getLanguage()->pipeList( $links ) );
+
+               return Xml::fieldset(
+                       $this->msg( 'whatlinkshere-filters' )->text(),
+                       $this->getLanguage()->pipeList( $links )
+               );
        }
 
        protected function getGroupName() {