Mark protected IndexPager properties also as protected in subclasses
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 20 Dec 2018 17:25:19 +0000 (18:25 +0100)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 20 Dec 2018 17:25:19 +0000 (18:25 +0100)
I'm intentionally only touching these protected properties and nothing
else, because I believe these are uncontroversial. They should be protected
according to modern SOLID standards, and actually are declared as
protected in the base class. What this patch effectively does is documenting
this fact, but it does not change anything.

Change-Id: I625307b58bd419c4a72e9842b2b46c08ed9b4f8e

13 files changed:
includes/actions/HistoryAction.php
includes/logging/LogPager.php
includes/pager/TablePager.php
includes/specials/pagers/ActiveUsersPager.php
includes/specials/pagers/AllMessagesTablePager.php
includes/specials/pagers/ContribsPager.php
includes/specials/pagers/DeletedContribsPager.php
includes/specials/pagers/ImageListPager.php
includes/specials/pagers/MergeHistoryPager.php
includes/specials/pagers/NewFilesPager.php
includes/specials/pagers/NewPagesPager.php
includes/specials/pagers/ProtectedTitlesPager.php
includes/specials/pagers/UsersPager.php

index 7d6b548..140ca2e 100644 (file)
@@ -492,7 +492,7 @@ class HistoryPager extends ReverseChronologicalPager {
                return $s;
        }
 
-       function doBatchLookups() {
+       protected function doBatchLookups() {
                if ( !Hooks::run( 'PageHistoryPager::doBatchLookups', [ $this, $this->mResult ] ) ) {
                        return;
                }
@@ -523,7 +523,7 @@ class HistoryPager extends ReverseChronologicalPager {
         *
         * @return string HTML output
         */
-       function getStartBody() {
+       protected function getStartBody() {
                $this->lastRow = false;
                $this->counter = 1;
                $this->oldIdChecked = 0;
@@ -585,7 +585,7 @@ class HistoryPager extends ReverseChronologicalPager {
                return $element;
        }
 
-       function getEndBody() {
+       protected function getEndBody() {
                if ( $this->lastRow ) {
                        $latest = $this->counter == 1 && $this->mIsFirst;
                        $firstInList = $this->counter == 1;
index e7096c4..b31f165 100644 (file)
@@ -365,7 +365,7 @@ class LogPager extends ReverseChronologicalPager {
                return 'log_timestamp';
        }
 
-       public function getStartBody() {
+       protected function getStartBody() {
                # Do a link batch query
                if ( $this->getNumRows() > 0 ) {
                        $lb = new LinkBatch;
index f38ed27..e99c33b 100644 (file)
@@ -110,7 +110,7 @@ abstract class TablePager extends IndexPager {
         * @protected
         * @return string
         */
-       function getStartBody() {
+       protected function getStartBody() {
                $sortClass = $this->getSortHeaderClass();
 
                $s = '';
@@ -162,7 +162,7 @@ abstract class TablePager extends IndexPager {
         * @protected
         * @return string
         */
-       function getEndBody() {
+       protected function getEndBody() {
                return "</tbody></table>\n";
        }
 
index 552e92f..7d9684a 100644 (file)
@@ -136,7 +136,7 @@ class ActiveUsersPager extends UsersPager {
                ];
        }
 
-       function doBatchLookups() {
+       protected function doBatchLookups() {
                parent::doBatchLookups();
 
                $uids = [];
index 6d5f64b..2d92b12 100644 (file)
@@ -276,7 +276,7 @@ class AllMessagesTablePager extends TablePager {
                return $result;
        }
 
-       function getStartBody() {
+       protected function getStartBody() {
                $tableClass = $this->getTableClass();
                return Xml::openElement( 'table', [
                        'class' => "mw-datatable $tableClass",
index 18da235..780f483 100644 (file)
@@ -363,7 +363,7 @@ class ContribsPager extends RangeChronologicalPager {
                }
        }
 
-       function doBatchLookups() {
+       protected function doBatchLookups() {
                # Do a link batch query
                $this->mResult->seek( 0 );
                $parentRevIds = [];
@@ -399,14 +399,14 @@ class ContribsPager extends RangeChronologicalPager {
        /**
         * @return string
         */
-       function getStartBody() {
+       protected function getStartBody() {
                return "<ul class=\"mw-contributions-list\">\n";
        }
 
        /**
         * @return string
         */
-       function getEndBody() {
+       protected function getEndBody() {
                return "</ul>\n";
        }
 
index ee7eb3e..c69a183 100644 (file)
@@ -139,11 +139,11 @@ class DeletedContribsPager extends IndexPager {
                return 'ar_timestamp';
        }
 
-       function getStartBody() {
+       protected function getStartBody() {
                return "<ul>\n";
        }
 
-       function getEndBody() {
+       protected function getEndBody() {
                return "</ul>\n";
        }
 
index 889ec1a..2a5e72d 100644 (file)
@@ -413,7 +413,7 @@ class ImageListPager extends TablePager {
                }
        }
 
-       function doBatchLookups() {
+       protected function doBatchLookups() {
                $userIds = [];
                $this->mResult->seek( 0 );
                foreach ( $this->mResult as $row ) {
index 6a8f7da..3dbec6a 100644 (file)
@@ -48,7 +48,7 @@ class MergeHistoryPager extends ReverseChronologicalPager {
                parent::__construct( $form->getContext() );
        }
 
-       function getStartBody() {
+       protected function getStartBody() {
                # Do a link batch query
                $this->mResult->seek( 0 );
                $batch = new LinkBatch();
index 6b7e4b8..6e16e79 100644 (file)
@@ -168,7 +168,7 @@ class NewFilesPager extends RangeChronologicalPager {
                return 'img_timestamp';
        }
 
-       function getStartBody() {
+       protected function getStartBody() {
                if ( !$this->gallery ) {
                        // Note that null for mode is taken to mean use default.
                        $mode = $this->getRequest()->getVal( 'gallerymode', null );
@@ -183,7 +183,7 @@ class NewFilesPager extends RangeChronologicalPager {
                return '';
        }
 
-       function getEndBody() {
+       protected function getEndBody() {
                return $this->gallery->toHTML();
        }
 
index f16a5cb..8263830 100644 (file)
@@ -140,7 +140,7 @@ class NewPagesPager extends ReverseChronologicalPager {
                return $this->mForm->formatRow( $row );
        }
 
-       function getStartBody() {
+       protected function getStartBody() {
                # Do a batch existence check on pages
                $linkBatch = new LinkBatch();
                foreach ( $this->mResult as $row ) {
@@ -153,7 +153,7 @@ class NewPagesPager extends ReverseChronologicalPager {
                return '<ul>';
        }
 
-       function getEndBody() {
+       protected function getEndBody() {
                return '</ul>';
        }
 }
index ed437be..d17e3c6 100644 (file)
@@ -37,7 +37,7 @@ class ProtectedTitlesPager extends AlphabeticPager {
                parent::__construct( $form->getContext() );
        }
 
-       function getStartBody() {
+       protected function getStartBody() {
                # Do a link batch query
                $this->mResult->seek( 0 );
                $lb = new LinkBatch;
index bc24d26..1ad0e21 100644 (file)
@@ -223,7 +223,7 @@ class UsersPager extends AlphabeticPager {
                return Html::rawElement( 'li', [], "{$item}{$edits}{$created}{$blocked}" );
        }
 
-       function doBatchLookups() {
+       protected function doBatchLookups() {
                $batch = new LinkBatch();
                $userIds = [];
                # Give some pointers to make user links