Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371378 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.11.0
......................................................................

build: Updating mediawiki/mediawiki-codesniffer to 0.11.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoCaseMatch
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle

The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment

Change-Id: I1130df565c6502393d5b1b727478fe93730a7963
---
M ProofreadPage.body.php
M ProofreadPage.namespaces.php
M composer.json
M includes/Context.php
M includes/Pagination/PageList.php
M includes/Pagination/PageNumber.php
M includes/Pagination/Pagination.php
M includes/Parser/PagesTagParser.php
M includes/ProofreadPageInit.php
M includes/index/IndexContent.php
M includes/index/ProofreadIndexDbConnector.php
M includes/index/ProofreadIndexPage.php
M includes/page/PageContentBuilder.php
M includes/page/PageLevel.php
M includes/page/ProofreadPageDbConnector.php
M includes/page/ProofreadPagePage.php
M phpcs.xml
M tests/phpunit/index/IndexContentTest.php
M tests/phpunit/page/PageLevelTest.php
19 files changed, 58 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/78/371378/1

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index eda957a..56b01ed 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -38,7 +38,7 @@
         *
         * Returns id of Page namespace.
         *
-        * @return integer
+        * @return int
         */
        public static function getPageNamespaceId() {
                return Context::getDefaultContext()->getPageNamespaceId();
@@ -49,7 +49,7 @@
         *
         * Returns id of Index namespace.
         *
-        * @return integer
+        * @return int
         */
        public static function getIndexNamespaceId() {
                return Context::getDefaultContext()->getIndexNamespaceId();
@@ -86,7 +86,7 @@
         *
         * @param Title $title the title page
         * @param string $model the content model for the page
-        * @return boolean if we have to continue the research for a content 
handler
+        * @return bool if we have to continue the research for a content 
handler
         */
        public static function onContentHandlerDefaultModelFor( Title $title, 
&$model ) {
                if ( $title->inNamespace( self::getPageNamespaceId() ) ) {
@@ -104,7 +104,7 @@
         * Set up our custom parser hooks when initializing parser.
         *
         * @param Parser $parser
-        * @return boolean hook return value
+        * @return bool hook return value
         */
        public static function onParserFirstCallInit( Parser $parser ) {
                $parser->setHook(
diff --git a/ProofreadPage.namespaces.php b/ProofreadPage.namespaces.php
index 572dcd7..63216c2 100644
--- a/ProofreadPage.namespaces.php
+++ b/ProofreadPage.namespaces.php
@@ -240,7 +240,7 @@
        'page' => 'ಪುಟ',
        'page_talk' => 'ಪುಟ_ಚರ್ಚೆ',
        'index' => 'ಪರಿವಿಡಿ',
-       'index_talk' =>  'ಪರಿವಿಡಿ_ಚರ್ಚೆ'
+       'index_talk' => 'ಪರಿವಿಡಿ_ಚರ್ಚೆ'
 ];
 
 /** Korean (한국어) */
@@ -264,7 +264,7 @@
        'page' => 'താൾ',
        'page_talk' => 'താളിന്റെ_സംവാദം',
        'index' => 'സൂചിക',
-       'index_talk' =>  'സൂചികയുടെ_സംവാദം'
+       'index_talk' => 'സൂചികയുടെ_സംവാദം'
 ];
 
 /** Marathi (मराठी) */
@@ -272,7 +272,7 @@
        'page' => 'पान',
        'page_talk' => 'पान_चर्चा',
        'index' => 'अनुक्रमणिका',
-       'index_talk' =>  'अनुक्रमणिका_चर्चा'
+       'index_talk' => 'अनुक्रमणिका_चर्चा'
 ];
 
 /** Norwegian (bokmål)‬ (‪norsk (bokmål)‬) */
@@ -320,7 +320,7 @@
        'page' => 'Pagină',
        'page_talk' => 'Discuție_Pagină',
        'index' => 'Index',
-       'index_talk' =>  'Discuție_Index'
+       'index_talk' => 'Discuție_Index'
 ];
 
 /** Russian (русский) */
diff --git a/composer.json b/composer.json
index c12a316..f9b12ef 100644
--- a/composer.json
+++ b/composer.json
@@ -9,7 +9,7 @@
        },
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
-               "mediawiki/mediawiki-codesniffer": "0.10.1",
+               "mediawiki/mediawiki-codesniffer": "0.11.0",
                "jakub-onderka/php-console-highlighter": "0.3.2"
        },
        "scripts": {
diff --git a/includes/Context.php b/includes/Context.php
index 129a27d..0bbd60d 100644
--- a/includes/Context.php
+++ b/includes/Context.php
@@ -54,14 +54,14 @@
        }
 
        /**
-        * @return integer
+        * @return int
         */
        public function getPageNamespaceId() {
                return $this->pageNamespaceId;
        }
 
        /**
-        * @return integer
+        * @return int
         */
        public function getIndexNamespaceId() {
                return $this->indexNamespaceId;
diff --git a/includes/Pagination/PageList.php b/includes/Pagination/PageList.php
index 5bca588..0991b00 100644
--- a/includes/Pagination/PageList.php
+++ b/includes/Pagination/PageList.php
@@ -29,7 +29,7 @@
        /**
         * Returns the PageNumber for the page number $pageNumber
         *
-        * @param integer $pageNumber
+        * @param int $pageNumber
         * @return PageNumber
         */
        public function getNumber( $pageNumber ) {
@@ -88,8 +88,8 @@
         * Such range may be a single integer or something in the format XXtoYY
         *
         * @param string $range
-        * @param integer $number
-        * @return boolean
+        * @param int $number
+        * @return bool
         */
        protected function numberInRange( $range, $number ) {
                return
diff --git a/includes/Pagination/PageNumber.php 
b/includes/Pagination/PageNumber.php
index 1913518..f786174 100644
--- a/includes/Pagination/PageNumber.php
+++ b/includes/Pagination/PageNumber.php
@@ -32,8 +32,8 @@
 
        /**
         * @param string $number the page number
-        * @param string  $displayMode the display mode (one of the DISPLAY_* 
constant)
-        * @param boolean $isEmpty
+        * @param string $displayMode the display mode (one of the DISPLAY_* 
constant)
+        * @param bool $isEmpty
         * @throws InvalidArgumentException
         */
        public function __construct( $number, $displayMode = 
self::DISPLAY_NORMAL, $isEmpty = false ) {
@@ -69,7 +69,7 @@
        }
 
        /**
-        * @return boolean
+        * @return bool
         */
        public function isEmpty() {
                return $this->isEmpty;
diff --git a/includes/Pagination/Pagination.php 
b/includes/Pagination/Pagination.php
index 6ee77b0..54da436 100644
--- a/includes/Pagination/Pagination.php
+++ b/includes/Pagination/Pagination.php
@@ -52,7 +52,7 @@
        /**
         * Returns the page number as it should be displayed from an internal 
page number
         *
-        * @param integer $pageNumber
+        * @param int $pageNumber
         * @return PageNumber
         * @throws OutOfBoundsException
         */
@@ -68,7 +68,7 @@
        /**
         * Returns the page number $pageNumber of the book
         *
-        * @param integer $pageNumber page number
+        * @param int $pageNumber page number
         * @return ProofreadPagePage
         * @throws OutOfBoundsException
         */
@@ -77,7 +77,7 @@
        /**
         * Returns if a page number $pageNumber exits
         *
-        * @param integer $pageNumber page number
+        * @param int $pageNumber page number
         * @return boolean
         */
        abstract protected function pageNumberExists( $pageNumber );
diff --git a/includes/Parser/PagesTagParser.php 
b/includes/Parser/PagesTagParser.php
index 5ccf5d2..e7f5053 100644
--- a/includes/Parser/PagesTagParser.php
+++ b/includes/Parser/PagesTagParser.php
@@ -97,7 +97,7 @@
                                // add page selected with $include in pagenums
                                if ( $include ) {
                                        $list = $this->parseNumList( $include );
-                                       if ( $list  == null ) {
+                                       if ( $list == null ) {
                                                return $this->formatError( 
'proofreadpage_invalid_interval' );
                                        }
                                        $pagenums = $list;
@@ -127,7 +127,7 @@
                                // remove excluded pages form $pagenums
                                if ( $exclude ) {
                                        $excluded = $this->parseNumList( 
$exclude );
-                                       if ( $excluded  == null ) {
+                                       if ( $excluded == null ) {
                                                return $this->formatError( 
'proofreadpage_invalid_interval' );
                                        }
                                        $pagenums = array_diff( $pagenums, 
$excluded );
diff --git a/includes/ProofreadPageInit.php b/includes/ProofreadPageInit.php
index 0f56ea1..c1b81d9 100644
--- a/includes/ProofreadPageInit.php
+++ b/includes/ProofreadPageInit.php
@@ -84,7 +84,7 @@
 
        /**
         * Create a namespace and his discussion one
-        * @param integer $id the namespace id
+        * @param int $id the namespace id
         * @param string $key the key of the namespace in the i18n file
         * @return bool false if there is an error, true if not
         */
@@ -158,7 +158,7 @@
         * Warning: It's not the function you search. If you want to know the 
index or page namespace
         * id use ProofreadPage::getIndexNamespaceId() or 
ProofreadPage::getPageNamespaceId()
         * @param string $key the key of the namespace in the i18n file
-        * @return integer
+        * @return int
         */
        public static function getNamespaceId( $key ) {
                global $wgProofreadPageNamespaceIds;
diff --git a/includes/index/IndexContent.php b/includes/index/IndexContent.php
index 23f77e4..0e113e4 100644
--- a/includes/index/IndexContent.php
+++ b/includes/index/IndexContent.php
@@ -206,7 +206,7 @@
        /**
         * Returns all links in a given namespace
         *
-        * @param integer $namespace the default namespace id
+        * @param int $namespace the default namespace id
         * @param Title $title the Index: page title
         * @param bool $withPrepossessing apply preprocessor before looking for 
links
         * @return Link[]
diff --git a/includes/index/ProofreadIndexDbConnector.php 
b/includes/index/ProofreadIndexDbConnector.php
index 9354771..7b452b9 100644
--- a/includes/index/ProofreadIndexDbConnector.php
+++ b/includes/index/ProofreadIndexDbConnector.php
@@ -43,7 +43,7 @@
 
        /**
         * @param Object $x
-        * @param integer $indexId
+        * @param int $indexId
         * @param WikiPage $article
         */
        public static function replaceIndexById( $x, $indexId, WikiPage 
$article ) {
@@ -110,13 +110,13 @@
        }
 
        /**
-        * @param integer $n
-        * @param integer $n0
-        * @param integer $n1
-        * @param integer $n2
-        * @param integer $n3
-        * @param integer $n4
-        * @param integer $indexId
+        * @param int $n
+        * @param int $n0
+        * @param int $n1
+        * @param int $n2
+        * @param int $n3
+        * @param int $n4
+        * @param int $indexId
         */
        public static function setIndexData( $n, $n0, $n1, $n2, $n3, $n4, 
$indexId ) {
                $dbw = wfGetDB( DB_MASTER );
@@ -138,7 +138,7 @@
 
        /**
         * Remove index data from pr_index table.
-        * @param integer $pageId page identifier
+        * @param int $pageId page identifier
         */
        public static function removeIndexData( $pageId ) {
                $dbw = wfGetDB( DB_MASTER );
@@ -163,7 +163,7 @@
        }
 
        /**
-        * @param integer $indexId
+        * @param int $indexId
         * @return Object
         */
        public static function getIndexDataFromIndexPageId( $indexId ) {
diff --git a/includes/index/ProofreadIndexPage.php 
b/includes/index/ProofreadIndexPage.php
index 9f01aad..c403b26 100644
--- a/includes/index/ProofreadIndexPage.php
+++ b/includes/index/ProofreadIndexPage.php
@@ -67,7 +67,7 @@
         * Check if two ProofreadIndexPage are equals
         *
         * @param ProofreadIndexPage $that
-        * @return boolean
+        * @return bool
         */
        public function equals( ProofreadIndexPage $that ) {
                return $this->title->equals( $that->getTitle() );
diff --git a/includes/page/PageContentBuilder.php 
b/includes/page/PageContentBuilder.php
index 52badec..0755e74 100644
--- a/includes/page/PageContentBuilder.php
+++ b/includes/page/PageContentBuilder.php
@@ -104,7 +104,7 @@
         * @param string $header
         * @param string $body
         * @param string $footer
-        * @param integer $level
+        * @param int $level
         * @param PageContent $oldContent the old content used as base for the 
new content
         * @return PageContent
         */
diff --git a/includes/page/PageLevel.php b/includes/page/PageLevel.php
index d1f5b43..39951ea 100644
--- a/includes/page/PageLevel.php
+++ b/includes/page/PageLevel.php
@@ -24,7 +24,7 @@
 
        /**
         * Constructor
-        * @param integer $level
+        * @param int $level
         * @param User|null $user
         */
        public function __construct( $level = 1, User $user = null ) {
@@ -34,7 +34,7 @@
 
        /**
         * returns the proofreading level
-        * @return integer
+        * @return int
         */
        public function getLevel() {
                return $this->level;
@@ -51,7 +51,7 @@
        /**
         * Returns if the level is valid
         *
-        * @return boolean
+        * @return bool
         */
        public function isValid() {
                return is_integer( $this->level ) && 0 <= $this->level && 
$this->level <= 4;
@@ -61,7 +61,7 @@
         * Returns if the level is the same as the level $that
         *
         * @param PageLevel $that
-        * @return boolean
+        * @return bool
         */
        public function equals( PageLevel $that = null ) {
                if ( $that === null ) {
@@ -79,7 +79,7 @@
         * Returns if the change of level to level $to is allowed
         *
         * @param PageLevel $to
-        * @return boolean
+        * @return bool
         */
        public function isChangeAllowed( PageLevel $to ) {
                if ( $this->level !== $to->getLevel() && ( $to->getUser() === 
null ||
diff --git a/includes/page/ProofreadPageDbConnector.php 
b/includes/page/ProofreadPageDbConnector.php
index 0df99d8..fc89a83 100644
--- a/includes/page/ProofreadPageDbConnector.php
+++ b/includes/page/ProofreadPageDbConnector.php
@@ -59,7 +59,7 @@
        /**
         * @param array $query
         * @param string $cat
-        * @return integer
+        * @return int
         */
        public static function queryCount( $query, $cat ) {
                $dbr = wfGetDB( DB_SLAVE );
@@ -103,7 +103,7 @@
        }
 
        /**
-        * @param integer $id
+        * @param int $id
         * @return string|null
         */
        public static function  getIndexTitleForPageId( $id ) {
@@ -136,7 +136,7 @@
        }
 
        /**
-        * @param integer $id
+        * @param int $id
         * @return integer|null
         */
        public static function countTransclusionFromPageId( $id ) {
diff --git a/includes/page/ProofreadPagePage.php 
b/includes/page/ProofreadPagePage.php
index 1bbce82..e179544 100644
--- a/includes/page/ProofreadPagePage.php
+++ b/includes/page/ProofreadPagePage.php
@@ -59,7 +59,7 @@
         * Check if two ProofreadPagePage are equals
         *
         * @param ProofreadPagePage $that
-        * @return boolean
+        * @return bool
         */
        public function equals( ProofreadPagePage $that ) {
                return $this->title->equals( $that->getTitle() );
diff --git a/phpcs.xml b/phpcs.xml
index 868ce12..46d4aa9 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,9 +1,17 @@
 <?xml version="1.0"?>
 <ruleset name="ProofreadPage">
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <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.Commenting.FunctionComment.ParamNameNoCaseMatch" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" 
/>
                <exclude 
name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures"
 />
                <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment"/>
-               <exclude name="MediaWiki.Commenting.FunctionComment"/>
        </rule>
        <rule ref="MediaWiki.NamingConventions.ValidGlobalName">
                <properties>
diff --git a/tests/phpunit/index/IndexContentTest.php 
b/tests/phpunit/index/IndexContentTest.php
index 3dd0172..5cd8ab6 100644
--- a/tests/phpunit/index/IndexContentTest.php
+++ b/tests/phpunit/index/IndexContentTest.php
@@ -259,7 +259,7 @@
                        [
                                new IndexContent( [
                                        'Pages' => new WikitextContent( '' ),
-                                       'Author'=> new WikitextContent( 
'[[Author:Me]]' )
+                                       'Author' => new WikitextContent( 
'[[Author:Me]]' )
                                ] ),
                                null
                        ]
diff --git a/tests/phpunit/page/PageLevelTest.php 
b/tests/phpunit/page/PageLevelTest.php
index e91c609..1105909 100644
--- a/tests/phpunit/page/PageLevelTest.php
+++ b/tests/phpunit/page/PageLevelTest.php
@@ -68,10 +68,10 @@
                $testUser = User::newFromName( 'Test' );
                $testUser->addToDatabase();
                $testUser->addGroup( 'user' );
-               $test2User =  User::newFromName( 'Test2' );
+               $test2User = User::newFromName( 'Test2' );
                $test2User->addToDatabase();
                $test2User->addGroup( 'user' );
-               $test3User =  User::newFromName( 'Test3' );
+               $test3User = User::newFromName( 'Test3' );
                $test3User->addToDatabase();
                $test3User->addGroup( 'sysop' );
                $ipUser = User::newFromName( '172.16.254.7', false );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1130df565c6502393d5b1b727478fe93730a7963
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>

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

Reply via email to