From: Thiemo Kreuz Date: Thu, 20 Dec 2018 17:25:19 +0000 (+0100) Subject: Mark protected IndexPager properties also as protected in subclasses X-Git-Tag: 1.34.0-rc.0~3193^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=5b1cda7ae18188ba751994cc69a47b62633444e3;p=lhc%2Fweb%2Fwiklou.git Mark protected IndexPager properties also as protected in subclasses 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 --- diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 7d6b548b0f..140ca2e2e8 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -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; diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index e7096c460a..b31f1657d4 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -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; diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php index f38ed27563..e99c33b3a4 100644 --- a/includes/pager/TablePager.php +++ b/includes/pager/TablePager.php @@ -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 "\n"; } diff --git a/includes/specials/pagers/ActiveUsersPager.php b/includes/specials/pagers/ActiveUsersPager.php index 552e92fb00..7d9684a0b5 100644 --- a/includes/specials/pagers/ActiveUsersPager.php +++ b/includes/specials/pagers/ActiveUsersPager.php @@ -136,7 +136,7 @@ class ActiveUsersPager extends UsersPager { ]; } - function doBatchLookups() { + protected function doBatchLookups() { parent::doBatchLookups(); $uids = []; diff --git a/includes/specials/pagers/AllMessagesTablePager.php b/includes/specials/pagers/AllMessagesTablePager.php index 6d5f64b7a2..2d92b12cc9 100644 --- a/includes/specials/pagers/AllMessagesTablePager.php +++ b/includes/specials/pagers/AllMessagesTablePager.php @@ -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", diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 18da235fde..780f483aaf 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -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 "\n"; } diff --git a/includes/specials/pagers/DeletedContribsPager.php b/includes/specials/pagers/DeletedContribsPager.php index ee7eb3e4d8..c69a18321b 100644 --- a/includes/specials/pagers/DeletedContribsPager.php +++ b/includes/specials/pagers/DeletedContribsPager.php @@ -139,11 +139,11 @@ class DeletedContribsPager extends IndexPager { return 'ar_timestamp'; } - function getStartBody() { + protected function getStartBody() { return "\n"; } diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index 889ec1af7c..2a5e72d9b6 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -413,7 +413,7 @@ class ImageListPager extends TablePager { } } - function doBatchLookups() { + protected function doBatchLookups() { $userIds = []; $this->mResult->seek( 0 ); foreach ( $this->mResult as $row ) { diff --git a/includes/specials/pagers/MergeHistoryPager.php b/includes/specials/pagers/MergeHistoryPager.php index 6a8f7da74e..3dbec6a2be 100644 --- a/includes/specials/pagers/MergeHistoryPager.php +++ b/includes/specials/pagers/MergeHistoryPager.php @@ -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(); diff --git a/includes/specials/pagers/NewFilesPager.php b/includes/specials/pagers/NewFilesPager.php index 6b7e4b8b31..6e16e7962e 100644 --- a/includes/specials/pagers/NewFilesPager.php +++ b/includes/specials/pagers/NewFilesPager.php @@ -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(); } diff --git a/includes/specials/pagers/NewPagesPager.php b/includes/specials/pagers/NewPagesPager.php index f16a5cb615..8263830bc3 100644 --- a/includes/specials/pagers/NewPagesPager.php +++ b/includes/specials/pagers/NewPagesPager.php @@ -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 ''; } } diff --git a/includes/specials/pagers/ProtectedTitlesPager.php b/includes/specials/pagers/ProtectedTitlesPager.php index ed437be5ab..d17e3c617b 100644 --- a/includes/specials/pagers/ProtectedTitlesPager.php +++ b/includes/specials/pagers/ProtectedTitlesPager.php @@ -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; diff --git a/includes/specials/pagers/UsersPager.php b/includes/specials/pagers/UsersPager.php index bc24d26a16..1ad0e21d12 100644 --- a/includes/specials/pagers/UsersPager.php +++ b/includes/specials/pagers/UsersPager.php @@ -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