aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2020-05-15 23:39:36 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2020-05-15 23:39:36 +0000
commitaa17c06c09f2408c18260d1c7e75412696d69f35 (patch)
treea9a8ebabab5e333cb269c4196dc99f8b253b54cb
parent32e00adbe9d3b7d1e3b161311f7ea2b5c021af1f (diff)
parent1af202073948385712bb18061908ad1fe786d28b (diff)
downloadmediawikicore-aa17c06c09f2408c18260d1c7e75412696d69f35.tar.gz
mediawikicore-aa17c06c09f2408c18260d1c7e75412696d69f35.zip
Merge "Fix numerous Squiz.Scope.MethodScope.Missing"
-rw-r--r--.phpcs.xml4
-rw-r--r--includes/CategoryViewer.php32
-rw-r--r--includes/diff/DiffEngine.php2
-rw-r--r--includes/htmlform/fields/HTMLTextAreaField.php2
-rw-r--r--includes/logging/LogPager.php2
5 files changed, 19 insertions, 23 deletions
diff --git a/.phpcs.xml b/.phpcs.xml
index c02ba6ddd197..bc2d043b5e30 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -41,13 +41,10 @@
</rule>
<rule ref="Squiz.Scope.MethodScope.Missing">
<exclude-pattern>includes/actions/</exclude-pattern>
- <exclude-pattern>includes/diff/DiffEngine\.php</exclude-pattern>
<exclude-pattern>includes/filerepo/</exclude-pattern>
<exclude-pattern>includes/historyblob/</exclude-pattern>
- <exclude-pattern>includes/htmlform/fields/HTMLTextAreaField\.php</exclude-pattern>
<exclude-pattern>includes/installer/</exclude-pattern>
<exclude-pattern>includes/libs/</exclude-pattern>
- <exclude-pattern>includes/logging/LogPager\.php</exclude-pattern>
<exclude-pattern>includes/media/</exclude-pattern>
<exclude-pattern>includes/page/</exclude-pattern>
<exclude-pattern>includes/pager/</exclude-pattern>
@@ -57,7 +54,6 @@
<exclude-pattern>includes/specialpage/</exclude-pattern>
<exclude-pattern>includes/specials/</exclude-pattern>
<exclude-pattern>includes/user/</exclude-pattern>
- <exclude-pattern>includes/CategoryViewer\.php</exclude-pattern>
<exclude-pattern>includes/Title\.php</exclude-pattern>
</rule>
<!-- See T238572 -->
diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index dcd4dd0bd65a..44470580f5a6 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -149,7 +149,7 @@ class CategoryViewer extends ContextSource {
return $r;
}
- function clearCategoryState() {
+ protected function clearCategoryState() {
$this->articles = [];
$this->articles_start_char = [];
$this->children = [];
@@ -177,7 +177,7 @@ class CategoryViewer extends ContextSource {
* @param string $sortkey
* @param int $pageLength
*/
- function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
+ public function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
// Subcategory; strip the 'Category' namespace from the link text.
$title = $cat->getTitle();
@@ -192,7 +192,7 @@ class CategoryViewer extends ContextSource {
$this->getSubcategorySortChar( $cat->getTitle(), $sortkey );
}
- function generateLink( $type, Title $title, $isRedirect, $html = null ) {
+ private function generateLink( $type, Title $title, $isRedirect, $html = null ) {
$link = null;
Hooks::run( 'CategoryViewer::generateLink', [ $type, $title, $html, &$link ] );
if ( $link === null ) {
@@ -220,7 +220,7 @@ class CategoryViewer extends ContextSource {
* @param string $sortkey The human-readable sortkey (before transforming to icu or whatever).
* @return string
*/
- function getSubcategorySortChar( $title, $sortkey ) {
+ public function getSubcategorySortChar( $title, $sortkey ) {
if ( $title->getPrefixedText() == $sortkey ) {
$word = $title->getDBkey();
} else {
@@ -239,7 +239,7 @@ class CategoryViewer extends ContextSource {
* @param int $pageLength
* @param bool $isRedirect
*/
- function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
+ public function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
if ( $this->showGallery ) {
$flip = $this->flip['file'];
if ( $flip ) {
@@ -262,14 +262,14 @@ class CategoryViewer extends ContextSource {
* @param int $pageLength
* @param bool $isRedirect
*/
- function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
+ public function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
$this->articles[] = $this->generateLink( 'page', $title, $isRedirect );
$this->articles_start_char[] = MediaWikiServices::getInstance()->
getContentLanguage()->convert( $this->collation->getFirstLetter( $sortkey ) );
}
- function finaliseCategoryState() {
+ protected function finaliseCategoryState() {
if ( $this->flip['subcat'] ) {
$this->children = array_reverse( $this->children );
$this->children_start_char = array_reverse( $this->children_start_char );
@@ -284,7 +284,7 @@ class CategoryViewer extends ContextSource {
}
}
- function doCategoryQuery() {
+ protected function doCategoryQuery() {
$dbr = wfGetDB( DB_REPLICA, 'category' );
$this->nextPage = [
@@ -389,7 +389,7 @@ class CategoryViewer extends ContextSource {
/**
* @return string
*/
- function getCategoryTop() {
+ protected function getCategoryTop() {
$r = $this->getCategoryBottom();
return $r === ''
? $r
@@ -399,7 +399,7 @@ class CategoryViewer extends ContextSource {
/**
* @return string
*/
- function getSubcategorySection() {
+ protected function getSubcategorySection() {
# Don't show subcategories section if there are none.
$r = '';
$rescnt = count( $this->children );
@@ -423,7 +423,7 @@ class CategoryViewer extends ContextSource {
/**
* @return string
*/
- function getPagesSection() {
+ protected function getPagesSection() {
$name = $this->getOutput()->getUnprefixedDisplayTitle();
# Don't show articles section if there are none.
$r = '';
@@ -453,7 +453,7 @@ class CategoryViewer extends ContextSource {
/**
* @return string
*/
- function getImageSection() {
+ protected function getImageSection() {
$name = $this->getOutput()->getUnprefixedDisplayTitle();
$r = '';
$rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery );
@@ -509,7 +509,7 @@ class CategoryViewer extends ContextSource {
/**
* @return string
*/
- function getCategoryBottom() {
+ protected function getCategoryBottom() {
return '';
}
@@ -523,7 +523,7 @@ class CategoryViewer extends ContextSource {
* @return string
* @private
*/
- function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
+ private function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
$list = '';
if ( count( $articles ) > $cutoff ) {
$list = self::columnList( $articles, $articles_start_char );
@@ -554,7 +554,7 @@ class CategoryViewer extends ContextSource {
* @return string HTML to output
* @private
*/
- static function columnList( $articles, $articles_start_char ) {
+ public static function columnList( $articles, $articles_start_char ) {
$columns = array_combine( $articles, $articles_start_char );
$ret = Html::openElement( 'div', [ 'class' => 'mw-category' ] );
@@ -595,7 +595,7 @@ class CategoryViewer extends ContextSource {
* @return string HTML to output
* @private
*/
- static function shortList( $articles, $articles_start_char ) {
+ public static function shortList( $articles, $articles_start_char ) {
$r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n";
$r .= '<ul><li>' . $articles[0] . '</li>';
$articleCount = count( $articles );
diff --git a/includes/diff/DiffEngine.php b/includes/diff/DiffEngine.php
index 8eda107b481c..0a522f506b4f 100644
--- a/includes/diff/DiffEngine.php
+++ b/includes/diff/DiffEngine.php
@@ -412,7 +412,7 @@ class DiffEngine {
$this->added = $added;
}
- function diff_range( $from_lines, $to_lines ) {
+ private function diff_range( $from_lines, $to_lines ) {
// Diff and store locally
$this->diff( $from_lines, $to_lines );
unset( $from_lines, $to_lines );
diff --git a/includes/htmlform/fields/HTMLTextAreaField.php b/includes/htmlform/fields/HTMLTextAreaField.php
index e9ed03198285..13efb75d22d5 100644
--- a/includes/htmlform/fields/HTMLTextAreaField.php
+++ b/includes/htmlform/fields/HTMLTextAreaField.php
@@ -88,7 +88,7 @@ class HTMLTextAreaField extends HTMLFormField {
return Html::textarea( $this->mName, $value, $attribs );
}
- function getInputOOUI( $value ) {
+ public function getInputOOUI( $value ) {
$classes = [];
if ( isset( $this->mParams['cols'] ) ) {
diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php
index 30ae7dc7f610..5769ee2ed361 100644
--- a/includes/logging/LogPager.php
+++ b/includes/logging/LogPager.php
@@ -390,7 +390,7 @@ class LogPager extends ReverseChronologicalPager {
);
}
- function getIndexField() {
+ public function getIndexField() {
return 'log_timestamp';
}