jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/405585 )

Change subject: Add PHPCS and fix found sniffs
......................................................................


Add PHPCS and fix found sniffs

Bug: T184416
Change-Id: Ib5705bc8c01c95274383e153034817774eda59f4
---
A .phpcs.xml
M WatchSubpages.alias.php
M WatchSubpages.php
M WatchSubpages_body.php
M composer.json
5 files changed, 207 insertions(+), 187 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 0000000..a6a83c2
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<ruleset>
+       <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <exclude name="Generic.Files.LineLength.TooLong" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
+               <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
+               <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
+       </rule>
+       <file>.</file>
+       <arg name="extensions" value="php,php5,inc" />
+       <arg name="encoding" value="utf8" />
+       <exclude-pattern>vendor</exclude-pattern>
+</ruleset>
\ No newline at end of file
diff --git a/WatchSubpages.alias.php b/WatchSubpages.alias.php
index fbfa4ae..0a6022d 100644
--- a/WatchSubpages.alias.php
+++ b/WatchSubpages.alias.php
@@ -5,241 +5,240 @@
  * @file
  * @ingroup Extensions
  */
-// @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
-$specialPageAliases['en'] = array(
-       'WatchSubpages' => array( 'WatchSubpages' ),
-);
+$specialPageAliases['en'] = [
+       'WatchSubpages' => [ 'WatchSubpages' ],
+];
 
 /** Arabic (العربية) */
-$specialPageAliases['ar'] = array(
-       'WatchSubpages' => array( 'مراقبة_الصفحات_الفرعية' ),
-);
+$specialPageAliases['ar'] = [
+       'WatchSubpages' => [ 'مراقبة_الصفحات_الفرعية' ],
+];
 
 /** Egyptian Arabic (مصرى) */
-$specialPageAliases['arz'] = array(
-       'WatchSubpages' => array( 'مراقبة_الصفح_الفرعيه' ),
-);
+$specialPageAliases['arz'] = [
+       'WatchSubpages' => [ 'مراقبة_الصفح_الفرعيه' ],
+];
 
 /** Assamese (অসমীয়া) */
-$specialPageAliases['as'] = array(
-       'WatchSubpages' => array( 'উপপৃষ্ঠাসমূহ_চাওক' ),
-);
+$specialPageAliases['as'] = [
+       'WatchSubpages' => [ 'উপপৃষ্ঠাসমূহ_চাওক' ],
+];
 
 /** Western Balochi (بلوچی رخشانی) */
-$specialPageAliases['bgn'] = array(
-       'WatchSubpages' => array( 'گۆنڈ_دیمانی_دیستین' ),
-);
+$specialPageAliases['bgn'] = [
+       'WatchSubpages' => [ 'گۆنڈ_دیمانی_دیستین' ],
+];
 
 /** Bosnian (bosanski) */
-$specialPageAliases['bs'] = array(
-       'WatchSubpages' => array( 'PratiPodstranice' ),
-);
+$specialPageAliases['bs'] = [
+       'WatchSubpages' => [ 'PratiPodstranice' ],
+];
 
 /** German (Deutsch) */
-$specialPageAliases['de'] = array(
-       'WatchSubpages' => array( 'Unterseiten_beobachten' ),
-);
+$specialPageAliases['de'] = [
+       'WatchSubpages' => [ 'Unterseiten_beobachten' ],
+];
 
 /** Zazaki (Zazaki) */
-$specialPageAliases['diq'] = array(
-       'WatchSubpages' => array( 'BınpelanSeyrKe' ),
-);
+$specialPageAliases['diq'] = [
+       'WatchSubpages' => [ 'BınpelanSeyrKe' ],
+];
 
 /** Lower Sorbian (dolnoserbski) */
-$specialPageAliases['dsb'] = array(
-       'WatchSubpages' => array( 'Pódboki wobglědowaś' ),
-);
+$specialPageAliases['dsb'] = [
+       'WatchSubpages' => [ 'Pódboki wobglědowaś' ],
+];
 
 /** Spanish (español) */
-$specialPageAliases['es'] = array(
-       'WatchSubpages' => array( 'Vigilar_subpáginas' ),
-);
+$specialPageAliases['es'] = [
+       'WatchSubpages' => [ 'Vigilar_subpáginas' ],
+];
 
 /** Persian (فارسی) */
-$specialPageAliases['fa'] = array(
-       'WatchSubpages' => array( 'پی‌گیری_زیرصفحه‌ها' ),
-);
+$specialPageAliases['fa'] = [
+       'WatchSubpages' => [ 'پی‌گیری_زیرصفحه‌ها' ],
+];
 
 /** Finnish (suomi) */
-$specialPageAliases['fi'] = array(
-       'WatchSubpages' => array( 'Tarkkaile_alasivuja' ),
-);
+$specialPageAliases['fi'] = [
+       'WatchSubpages' => [ 'Tarkkaile_alasivuja' ],
+];
 
 /** French (français) */
-$specialPageAliases['fr'] = array(
-       'WatchSubpages' => array( 'Voir_les_sous-pages', 'VoirSousPages' ),
-);
+$specialPageAliases['fr'] = [
+       'WatchSubpages' => [ 'Voir_les_sous-pages', 'VoirSousPages' ],
+];
 
 /** Arpitan (arpetan) */
-$specialPageAliases['frp'] = array(
-       'WatchSubpages' => array( 'Siuvre_les_sot-pâges', 'SiuvreLesSotPâges' ),
-);
+$specialPageAliases['frp'] = [
+       'WatchSubpages' => [ 'Siuvre_les_sot-pâges', 'SiuvreLesSotPâges' ],
+];
 
 /** Galician (galego) */
-$specialPageAliases['gl'] = array(
-       'WatchSubpages' => array( 'Vixiar_as_subpáxinas' ),
-);
+$specialPageAliases['gl'] = [
+       'WatchSubpages' => [ 'Vixiar_as_subpáxinas' ],
+];
 
 /** Swiss German (Alemannisch) */
-$specialPageAliases['gsw'] = array(
-       'WatchSubpages' => array( 'Untersyte_beobachte' ),
-);
+$specialPageAliases['gsw'] = [
+       'WatchSubpages' => [ 'Untersyte_beobachte' ],
+];
 
 /** Gujarati (ગુજરાતી) */
-$specialPageAliases['gu'] = array(
-       'WatchSubpages' => array( 'ઉપપાનાઓ_જુઓ' ),
-);
+$specialPageAliases['gu'] = [
+       'WatchSubpages' => [ 'ઉપપાનાઓ_જુઓ' ],
+];
 
 /** Hebrew (עברית) */
-$specialPageAliases['he'] = array(
-       'WatchSubpages' => array( 'מעקב_אחרי_דפי־משנה' ),
-);
+$specialPageAliases['he'] = [
+       'WatchSubpages' => [ 'מעקב_אחרי_דפי־משנה' ],
+];
 
 /** Croatian (hrvatski) */
-$specialPageAliases['hr'] = array(
-       'WatchSubpages' => array( 'Prati_podstranice' ),
-);
+$specialPageAliases['hr'] = [
+       'WatchSubpages' => [ 'Prati_podstranice' ],
+];
 
 /** Upper Sorbian (hornjoserbsce) */
-$specialPageAliases['hsb'] = array(
-       'WatchSubpages' => array( 'Podstrony_wobkedźbować' ),
-);
+$specialPageAliases['hsb'] = [
+       'WatchSubpages' => [ 'Podstrony_wobkedźbować' ],
+];
 
 /** Haitian (Kreyòl ayisyen) */
-$specialPageAliases['ht'] = array(
-       'WatchSubpages' => array( 'GadeSouPaj' ),
-);
+$specialPageAliases['ht'] = [
+       'WatchSubpages' => [ 'GadeSouPaj' ],
+];
 
 /** Hungarian (magyar) */
-$specialPageAliases['hu'] = array(
-       'WatchSubpages' => array( 'Aloldalak_figyelése' ),
-);
+$specialPageAliases['hu'] = [
+       'WatchSubpages' => [ 'Aloldalak_figyelése' ],
+];
 
 /** Interlingua (interlingua) */
-$specialPageAliases['ia'] = array(
-       'WatchSubpages' => array( 'Observar_subpaginas' ),
-);
+$specialPageAliases['ia'] = [
+       'WatchSubpages' => [ 'Observar_subpaginas' ],
+];
 
 /** Indonesian (Bahasa Indonesia) */
-$specialPageAliases['id'] = array(
-       'WatchSubpages' => array( 'Pantau_subhalaman', 'PantauSubhalaman' ),
-);
+$specialPageAliases['id'] = [
+       'WatchSubpages' => [ 'Pantau_subhalaman', 'PantauSubhalaman' ],
+];
 
 /** Japanese (日本語) */
-$specialPageAliases['ja'] = array(
-       'WatchSubpages' => array( '下位ページのウォッチ', 'サブページのウォッチ' ),
-);
+$specialPageAliases['ja'] = [
+       'WatchSubpages' => [ '下位ページのウォッチ', 'サブページのウォッチ' ],
+];
 
 /** Korean (한국어) */
-$specialPageAliases['ko'] = array(
-       'WatchSubpages' => array( '하위문서주시' ),
-);
+$specialPageAliases['ko'] = [
+       'WatchSubpages' => [ '하위문서주시' ],
+];
 
 /** Colognian (Ripoarisch) */
-$specialPageAliases['ksh'] = array(
-       'WatchSubpages' => array( 'Op Ungersigge oppasse', 'Op Ongersigge 
oppasse' ),
-);
+$specialPageAliases['ksh'] = [
+       'WatchSubpages' => [ 'Op Ungersigge oppasse', 'Op Ongersigge oppasse' ],
+];
 
 /** Luxembourgish (Lëtzebuergesch) */
-$specialPageAliases['lb'] = array(
-       'WatchSubpages' => array( 'Ënnersäiten_iwwerwaachen' ),
-);
+$specialPageAliases['lb'] = [
+       'WatchSubpages' => [ 'Ënnersäiten_iwwerwaachen' ],
+];
 
 /** Macedonian (македонски) */
-$specialPageAliases['mk'] = array(
-       'WatchSubpages' => array( 'НабљудувајПотстраници' ),
-);
+$specialPageAliases['mk'] = [
+       'WatchSubpages' => [ 'НабљудувајПотстраници' ],
+];
 
 /** Malayalam (മലയാളം) */
-$specialPageAliases['ml'] = array(
-       'WatchSubpages' => array( 'ഉപതാളുകൾശ്രദ്ധിക്കുക' ),
-);
+$specialPageAliases['ml'] = [
+       'WatchSubpages' => [ 'ഉപതാളുകൾശ്രദ്ധിക്കുക' ],
+];
 
 /** Marathi (मराठी) */
-$specialPageAliases['mr'] = array(
-       'WatchSubpages' => array( 'उपपृष्ठेबघा' ),
-);
+$specialPageAliases['mr'] = [
+       'WatchSubpages' => [ 'उपपृष्ठेबघा' ],
+];
 
 /** Norwegian Bokmål (norsk bokmål) */
-$specialPageAliases['nb'] = array(
-       'WatchSubpages' => array( 'Overvåk_undersider' ),
-);
+$specialPageAliases['nb'] = [
+       'WatchSubpages' => [ 'Overvåk_undersider' ],
+];
 
 /** Low Saxon (Netherlands) (Nedersaksies) */
-$specialPageAliases['nds-nl'] = array(
-       'WatchSubpages' => array( 'Subziejen_op_volglieste' ),
-);
+$specialPageAliases['nds-nl'] = [
+       'WatchSubpages' => [ 'Subziejen_op_volglieste' ],
+];
 
 /** Dutch (Nederlands) */
-$specialPageAliases['nl'] = array(
-       'WatchSubpages' => array( 'SubpaginasOpVolglijst', 
'Subpagina\'sOpVolglijst' ),
-);
+$specialPageAliases['nl'] = [
+       'WatchSubpages' => [ 'SubpaginasOpVolglijst', 'Subpagina\'sOpVolglijst' 
],
+];
 
 /** Occitan (occitan) */
-$specialPageAliases['oc'] = array(
-       'WatchSubpages' => array( 'VeireSosPaginas' ),
-);
+$specialPageAliases['oc'] = [
+       'WatchSubpages' => [ 'VeireSosPaginas' ],
+];
 
 /** Portuguese (português) */
-$specialPageAliases['pt'] = array(
-       'WatchSubpages' => array( 'Vigiar_subpáginas' ),
-);
+$specialPageAliases['pt'] = [
+       'WatchSubpages' => [ 'Vigiar_subpáginas' ],
+];
 
 /** Sanskrit (संस्कृतम्) */
-$specialPageAliases['sa'] = array(
-       'WatchSubpages' => array( 'उपपृष्ठनिरीक्षा' ),
-);
+$specialPageAliases['sa'] = [
+       'WatchSubpages' => [ 'उपपृष्ठनिरीक्षा' ],
+];
 
 /** Slovak (slovenčina) */
-$specialPageAliases['sk'] = array(
-       'WatchSubpages' => array( 'SledovaniePodstránok' ),
-);
+$specialPageAliases['sk'] = [
+       'WatchSubpages' => [ 'SledovaniePodstránok' ],
+];
 
 /** Swedish (svenska) */
-$specialPageAliases['sv'] = array(
-       'WatchSubpages' => array( 'Bevaka_undersidor' ),
-);
+$specialPageAliases['sv'] = [
+       'WatchSubpages' => [ 'Bevaka_undersidor' ],
+];
 
 /** Swahili (Kiswahili) */
-$specialPageAliases['sw'] = array(
-       'WatchSubpages' => array( 'AngaliaKurasandogo' ),
-);
+$specialPageAliases['sw'] = [
+       'WatchSubpages' => [ 'AngaliaKurasandogo' ],
+];
 
 /** Telugu (తెలుగు) */
-$specialPageAliases['te'] = array(
-       'WatchSubpages' => array( 'ఉపపేజీలువీక్షించు' ),
-);
+$specialPageAliases['te'] = [
+       'WatchSubpages' => [ 'ఉపపేజీలువీక్షించు' ],
+];
 
 /** Thai (ไทย) */
-$specialPageAliases['th'] = array(
-       'WatchSubpages' => array( 'เฝ้าดูหน้าย่อย' ),
-);
+$specialPageAliases['th'] = [
+       'WatchSubpages' => [ 'เฝ้าดูหน้าย่อย' ],
+];
 
 /** Tagalog (Tagalog) */
-$specialPageAliases['tl'] = array(
-       'WatchSubpages' => array( 'Bantayan_ang_kabahaging_mga_pahina' ),
-);
+$specialPageAliases['tl'] = [
+       'WatchSubpages' => [ 'Bantayan_ang_kabahaging_mga_pahina' ],
+];
 
 /** Turkish (Türkçe) */
-$specialPageAliases['tr'] = array(
-       'WatchSubpages' => array( 'Altsayfalarıİzle' ),
-);
+$specialPageAliases['tr'] = [
+       'WatchSubpages' => [ 'Altsayfalarıİzle' ],
+];
 
 /** Vietnamese (Tiếng Việt) */
-$specialPageAliases['vi'] = array(
-       'WatchSubpages' => array( 'Theo_dõi_trang_phụ' ),
-);
+$specialPageAliases['vi'] = [
+       'WatchSubpages' => [ 'Theo_dõi_trang_phụ' ],
+];
 
 /** Simplified Chinese (中文(简体)‎) */
-$specialPageAliases['zh-hans'] = array(
-       'WatchSubpages' => array( '监视子页面' ),
-);
+$specialPageAliases['zh-hans'] = [
+       'WatchSubpages' => [ '监视子页面' ],
+];
 
 /** Traditional Chinese (中文(繁體)‎) */
-$specialPageAliases['zh-hant'] = array(
-       'WatchSubpages' => array( '監視子頁面' ),
-);
\ No newline at end of file
+$specialPageAliases['zh-hant'] = [
+       'WatchSubpages' => [ '監視子頁面' ],
+];
diff --git a/WatchSubpages.php b/WatchSubpages.php
index 5fb9747..692817e 100644
--- a/WatchSubpages.php
+++ b/WatchSubpages.php
@@ -30,4 +30,4 @@
        return;
 } else {
        die( 'This version of the WatchSubpages extension requires MediaWiki 
1.25+' );
-}
\ No newline at end of file
+}
diff --git a/WatchSubpages_body.php b/WatchSubpages_body.php
index 3bd0185..a60b3f7 100644
--- a/WatchSubpages_body.php
+++ b/WatchSubpages_body.php
@@ -83,7 +83,7 @@
                }
 
                $nsForm = $this->namespacePrefixForm( $namespace, $showme );
-               $this->toc = Xml::openElement( 'table', array( 'id' => 
'mw-prefixindex-nav-table' ) ) .
+               $this->toc = Xml::openElement( 'table', [ 'id' => 
'mw-prefixindex-nav-table' ] ) .
                        '<tr>
                                <td>' .
                        $nsForm .
@@ -113,18 +113,18 @@
        protected function namespacePrefixForm( $namespace = NS_MAIN, $from = 
'' ) {
                global $wgScript;
 
-               $out = Xml::openElement( 'div', array( 'class' => 
'namespaceoptions' ) );
-               $out .= Xml::openElement( 'form', array( 'method' => 'get', 
'action' => $wgScript ) );
+               $out = Xml::openElement( 'div', [ 'class' => 'namespaceoptions' 
] );
+               $out .= Xml::openElement( 'form', [ 'method' => 'get', 'action' 
=> $wgScript ] );
                $out .= Html::hidden( 'title', 
$this->getPageTitle()->getPrefixedText() );
                $out .= Xml::openElement( 'fieldset' );
                $out .= Xml::element( 'legend', null, $this->msg( 
'watchsubpages' )->text() );
-               $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 
'class' => 'allpages' ) );
+               $out .= Xml::openElement( 'table', [ 'id' => 'nsselect', 
'class' => 'allpages' ] );
                $out .= "<tr>
                                <td class='mw-label'>" .
                        Xml::label( $this->msg( 'watchsubpagesprefix' 
)->text(), 'nsfrom' ) .
                        "</td>
                                <td class='mw-input'>" .
-                       Xml::input( 'prefix', 30, str_replace( '_', ' ', $from 
), array( 'id' => 'nsfrom' ) ) .
+                       Xml::input( 'prefix', 30, str_replace( '_', ' ', $from 
), [ 'id' => 'nsfrom' ] ) .
                        "</td>
                        </tr>
                        <tr>
@@ -132,13 +132,13 @@
                        Xml::label( $this->msg( 'namespace' )->text(), 
'namespace' ) .
                        "</td>
                                <td class='mw-input'>" .
-                       Html::namespaceSelector( array(
+                       Html::namespaceSelector( [
                                'selected' => $namespace,
-                       ), array(
+                       ], [
                                'name' => 'namespace',
                                'id' => 'namespace',
                                'class' => 'namespaceselector',
-                       ) ) .
+                       ] ) .
                        Xml::checkLabel(
                                $this->msg( 'allpages-hide-redirects' )->text(),
                                'hideredirects',
@@ -184,28 +184,28 @@
 
                list( $namespace, $prefixKey, $prefix ) = $prefixList;
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
 
-               $conds = array(
+               $conds = [
                        'page_namespace' => $namespace,
-                       'page_title' . $dbr->buildLike( $prefixKey . '/' , 
$dbr->anyString() ),
-               );
+                       'page_title' . $dbr->buildLike( $prefixKey . '/', 
$dbr->anyString() ),
+               ];
 
                if ( $this->hideRedirects ) {
                        $conds['page_is_redirect'] = 0;
                }
 
                $res = $dbr->select( 'page',
-                       array( 'page_namespace', 'page_title', 
'page_is_redirect' ),
+                       [ 'page_namespace', 'page_title', 'page_is_redirect' ],
                        $conds,
                        __METHOD__,
-                       array(
+                       [
                                'ORDER BY' => 'page_title',
                                'USE INDEX' => 'name_title',
-                       )
+                       ]
                );
 
-               $pages = array();
+               $pages = [];
 
                if ( $res->numRows() > 0 ) {
                        $lb = new LinkBatch();
@@ -220,25 +220,25 @@
 
                $dispNamespace = MWNamespace::getSubject( $namespace );
 
-               $fields = array();
+               $fields = [];
 
-               $fields['prefix'] = array(
+               $fields['prefix'] = [
                                'type' => 'hidden',
                                'name' => 'prefix',
                                'default' => $prefix
-               );
+               ];
 
-               $fields['namespace'] = array(
+               $fields['namespace'] = [
                                'type' => 'hidden',
                                'name' => 'namespace',
                                'default' => $namespace
-               );
+               ];
 
-               $fields['Titles'] = array(
+               $fields['Titles'] = [
                        'class' => 'EditWatchlistCheckboxSeriesField',
-                       'options' => array(),
+                       'options' => [],
                        'section' => "ns$dispNamespace",
-               );
+               ];
 
                foreach ( array_keys( $pages ) as $dbkey ) {
                        $title = Title::makeTitleSafe( $dispNamespace, $dbkey );
@@ -256,7 +256,7 @@
                $form->setSubmitTooltip( 'watchsubpages-submit' );
                $form->setWrapperLegendMsg( 'watchsubpages-legend' );
                $form->addHeaderText( $this->msg( 'watchsubpages-explain' 
)->parse() );
-               $form->setSubmitCallback( array( $this, 'submitRaw' ) );
+               $form->setSubmitCallback( [ $this, 'submitRaw' ] );
 
                return $form;
        }
@@ -266,17 +266,17 @@
         *
         * @param $ns Integer: the namespace of the article
         * @param string $text the name of the article
-        * @return array( int namespace, string dbkey, string pagename ) or 
NULL on error
+        * @return array int namespace, string dbkey, string pagename ) or NULL 
on error
         */
        protected function getNamespaceKeyAndText( $ns, $text ) {
                if ( $text == '' ) {
                        # shortcut for common case
-                       return array( $ns, '', '' );
+                       return [ $ns, '', '' ];
                }
 
                $t = Title::makeTitleSafe( $ns, $text );
                if ( $t && $t->isLocal() ) {
-                       return array( $t->getNamespace(), $t->getDBkey(), 
$t->getText() );
+                       return [ $t->getNamespace(), $t->getDBkey(), 
$t->getText() ];
                } elseif ( $t ) {
                        return null;
                }
@@ -285,7 +285,7 @@
                $text = preg_replace( '/(#|$)/', 'X$1', $text );
                $t = Title::makeTitleSafe( $ns, $text );
                if ( $t && $t->isLocal() ) {
-                       return array( $t->getNamespace(), '', '' );
+                       return [ $t->getNamespace(), '', '' ];
                } else {
                        return null;
                }
@@ -313,8 +313,8 @@
                        $tools[] = Linker::linkKnown(
                                $title,
                                $this->msg( 'history_short' )->escaped(),
-                               array(),
-                               array( 'action' => 'history' )
+                               [],
+                               [ 'action' => 'history' ]
                        );
                }
 
@@ -325,7 +325,7 @@
                        );
                }
 
-               Hooks::run( 'WatchlistEditorBuildRemoveLine', array( &$tools, 
$title, $title->isRedirect(), $this->getSkin() ) );
+               Hooks::run( 'WatchlistEditorBuildRemoveLine', [ &$tools, 
$title, $title->isRedirect(), $this->getSkin() ] );
 
                return $link . " (" . $this->getLanguage()->pipeList( $tools ) 
. ")";
        }
@@ -364,21 +364,21 @@
         * @return array
         */
        private function getWatchlist() {
-               $list = array();
+               $list = [];
                $dbr = wfGetDB( DB_MASTER );
 
                $res = $dbr->select(
                        'watchlist',
-                       array(
+                       [
                                'wl_namespace', 'wl_title'
-                       ), array(
+                       ], [
                                'wl_user' => $this->getUser()->getId(),
-                       ),
+                       ],
                        __METHOD__
                );
 
                if ( $res->numRows() > 0 ) {
-                       $titles = array();
+                       $titles = [];
                        foreach ( $res as $row ) {
                                $title = Title::makeTitleSafe( 
$row->wl_namespace, $row->wl_title );
 
@@ -410,7 +410,7 @@
         */
        private function watchTitles( $titles ) {
                $dbw = wfGetDB( DB_MASTER );
-               $rows = array();
+               $rows = [];
 
                foreach ( $titles as $title ) {
                        if ( !$title instanceof Title ) {
@@ -418,18 +418,18 @@
                        }
 
                        if ( $title instanceof Title ) {
-                               $rows[] = array(
+                               $rows[] = [
                                        'wl_user' => $this->getUser()->getId(),
                                        'wl_namespace' => 
MWNamespace::getSubject( $title->getNamespace() ),
                                        'wl_title' => $title->getDBkey(),
                                        'wl_notificationtimestamp' => null,
-                               );
-                               $rows[] = array(
+                               ];
+                               $rows[] = [
                                        'wl_user' => $this->getUser()->getId(),
                                        'wl_namespace' => MWNamespace::getTalk( 
$title->getNamespace() ),
                                        'wl_title' => $title->getDBkey(),
                                        'wl_notificationtimestamp' => null,
-                               );
+                               ];
                        }
                }
 
diff --git a/composer.json b/composer.json
index 7d306d5..a9ad44d 100644
--- a/composer.json
+++ b/composer.json
@@ -1,16 +1,19 @@
 {
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
+               "mediawiki/mediawiki-codesniffer": "15.0.0",
                "jakub-onderka/php-console-highlighter": "0.3.2",
                "mediawiki/minus-x": "0.2.1"
        },
        "scripts": {
                "test": [
                        "parallel-lint . --exclude vendor --exclude 
node_modules",
+                       "phpcs -p -s",
                        "minus-x check ."
                ],
                "fix": [
+                       "phpcbf",
                        "minus-x fix ."
                ]
        }
-}
+}
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/405585
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib5705bc8c01c95274383e153034817774eda59f4
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/WatchSubpages
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio <maure...@tools.wmflabs.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Mainframe98 <k.s.w...@hotmail.com>
Gerrit-Reviewer: Platonides <platoni...@gmail.com>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to