Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339131 )

Change subject: Remove a lot of non-informative "getFoo returns foo" comments
......................................................................

Remove a lot of non-informative "getFoo returns foo" comments

A comment that does nothing but repeating what is already obvious from
the method name is worse than no comment. It is clutter people have to
read, only to understand that it does not add anything.

I found candidates with a regex for short comments that start with
"* Returns …". Inspired by I73eecba.

Change-Id: I8d8228cff51bae814d1c4c8924b8639417b6e094
---
M lib/includes/Changes/Change.php
M lib/includes/Changes/ChangeRow.php
M repo/includes/Diff/ClaimDifference.php
M repo/includes/Diff/EntityDiffVisualizer.php
M repo/includes/EditEntity.php
M repo/includes/Specials/SpecialMergeItems.php
M repo/includes/Specials/SpecialModifyEntity.php
M repo/includes/Specials/SpecialNewEntity.php
M repo/includes/Specials/SpecialRedirectEntity.php
M repo/includes/Store/EntitiesWithoutTermFinder.php
M repo/includes/Store/ItemsWithoutSitelinksFinder.php
M repo/includes/Store/Sql/SqlItemsWithoutSitelinksFinder.php
M repo/includes/WikibaseRepo.php
13 files changed, 5 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/31/339131/1

diff --git a/lib/includes/Changes/Change.php b/lib/includes/Changes/Change.php
index dc33f14..91ed994 100644
--- a/lib/includes/Changes/Change.php
+++ b/lib/includes/Changes/Change.php
@@ -8,7 +8,6 @@
  * @license GPL-2.0+
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  */
-
 interface Change {
 
        /**
@@ -33,9 +32,7 @@
        public function getTime();
 
        /**
-        * Returns the id of the change.
-        *
-        * @return int|null
+        * @return int|null Number to be used as an identifier when persisting 
the change.
         */
        public function getId();
 
diff --git a/lib/includes/Changes/ChangeRow.php 
b/lib/includes/Changes/ChangeRow.php
index 52f9204..1607c99 100644
--- a/lib/includes/Changes/ChangeRow.php
+++ b/lib/includes/Changes/ChangeRow.php
@@ -200,9 +200,7 @@
        }
 
        /**
-        * Returns the objects database id.
-        *
-        * @return int|null
+        * @return int|null Number to be used as an identifier when persisting 
the change.
         */
        public function getId() {
                return $this->getField( 'id' );
diff --git a/repo/includes/Diff/ClaimDifference.php 
b/repo/includes/Diff/ClaimDifference.php
index fc2e8d9..18f5670 100644
--- a/repo/includes/Diff/ClaimDifference.php
+++ b/repo/includes/Diff/ClaimDifference.php
@@ -55,8 +55,6 @@
        }
 
        /**
-        * Returns the set of reference changes.
-        *
         * @return Diff
         */
        public function getReferenceChanges() {
@@ -64,8 +62,6 @@
        }
 
        /**
-        * Returns the main snak change.
-        *
         * @return DiffOpChange|null
         */
        public function getMainSnakChange() {
@@ -73,8 +69,6 @@
        }
 
        /**
-        * Returns the rank change.
-        *
         * @return DiffOpChange|null
         */
        public function getRankChange() {
@@ -82,8 +76,6 @@
        }
 
        /**
-        * Returns the set of qualifier changes.
-        *
         * @return Diff
         */
        public function getQualifierChanges() {
diff --git a/repo/includes/Diff/EntityDiffVisualizer.php 
b/repo/includes/Diff/EntityDiffVisualizer.php
index 87d7c7f..871d586 100644
--- a/repo/includes/Diff/EntityDiffVisualizer.php
+++ b/repo/includes/Diff/EntityDiffVisualizer.php
@@ -168,11 +168,9 @@
        }
 
        /**
-        * Returns the HTML for a single claim DiffOp.
-        *
         * @param DiffOp $claimDiffOp
         *
-        * @return string
+        * @return string HTML
         * @throws MWException
         */
        protected function getClaimDiffHtml( DiffOp $claimDiffOp ) {
diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php
index 35b2b77..3e59d71 100644
--- a/repo/includes/EditEntity.php
+++ b/repo/includes/EditEntity.php
@@ -284,8 +284,6 @@
        }
 
        /**
-        * Returns the latest revision ID.
-        *
         * @return int 0 if the entity doesn't exist
         */
        private function getLatestRevisionId() {
@@ -319,7 +317,6 @@
        }
 
        /**
-        * Returns the base revision ID.
         * If no base revision was supplied to the constructor, this will 
return false.
         * In the trivial non-conflicting case, this will be the same as 
$this->getLatestRevisionId().
         *
diff --git a/repo/includes/Specials/SpecialMergeItems.php 
b/repo/includes/Specials/SpecialMergeItems.php
index 9f5abb5..a843693 100644
--- a/repo/includes/Specials/SpecialMergeItems.php
+++ b/repo/includes/Specials/SpecialMergeItems.php
@@ -225,9 +225,7 @@
        }
 
        /**
-        * Returns the form elements.
-        *
-        * @return array
+        * @return array[]
         */
        protected function getFormElements() {
                return array(
diff --git a/repo/includes/Specials/SpecialModifyEntity.php 
b/repo/includes/Specials/SpecialModifyEntity.php
index afb516a..4761bdf 100644
--- a/repo/includes/Specials/SpecialModifyEntity.php
+++ b/repo/includes/Specials/SpecialModifyEntity.php
@@ -291,8 +291,6 @@
        }
 
        /**
-        * Returns the form elements.
-        *
         * @param EntityDocument|null $entity
         *
         * @return string HTML
diff --git a/repo/includes/Specials/SpecialNewEntity.php 
b/repo/includes/Specials/SpecialNewEntity.php
index 4481201..defa20a 100644
--- a/repo/includes/Specials/SpecialNewEntity.php
+++ b/repo/includes/Specials/SpecialNewEntity.php
@@ -97,8 +97,6 @@
        abstract protected function getLegend();
 
        /**
-        * Returns any warnings.
-        *
         * @return string[] Warnings that should be presented to the user
         */
        abstract protected function getWarnings();
diff --git a/repo/includes/Specials/SpecialRedirectEntity.php 
b/repo/includes/Specials/SpecialRedirectEntity.php
index 9343fb4..c543291 100644
--- a/repo/includes/Specials/SpecialRedirectEntity.php
+++ b/repo/includes/Specials/SpecialRedirectEntity.php
@@ -183,9 +183,7 @@
        }
 
        /**
-        * Returns the form elements.
-        *
-        * @return array
+        * @return array[]
         */
        protected function getFormElements() {
                return array(
diff --git a/repo/includes/Store/EntitiesWithoutTermFinder.php 
b/repo/includes/Store/EntitiesWithoutTermFinder.php
index 5bb1a04..f8174b7 100644
--- a/repo/includes/Store/EntitiesWithoutTermFinder.php
+++ b/repo/includes/Store/EntitiesWithoutTermFinder.php
@@ -14,8 +14,6 @@
 interface EntitiesWithoutTermFinder {
 
        /**
-        * Return all entities without a specify term
-        *
         * @param string $termType Can be any member of the 
TermIndexEntry::TYPE_ enum
         * @param string|null $language Restrict the search for one language. 
By default the search is done for all languages.
         * @param string[]|null $entityTypes Array containing the entity types 
to search for, typically
diff --git a/repo/includes/Store/ItemsWithoutSitelinksFinder.php 
b/repo/includes/Store/ItemsWithoutSitelinksFinder.php
index 5268d5d..d9f3a00 100644
--- a/repo/includes/Store/ItemsWithoutSitelinksFinder.php
+++ b/repo/includes/Store/ItemsWithoutSitelinksFinder.php
@@ -14,7 +14,6 @@
 interface ItemsWithoutSitelinksFinder {
 
        /**
-        * Return all items without sitelinks
         * TODO: In the future, we probably want a non-numeric offset here, see 
T67333.
         *
         * @param integer $limit Limit of the query.
diff --git a/repo/includes/Store/Sql/SqlItemsWithoutSitelinksFinder.php 
b/repo/includes/Store/Sql/SqlItemsWithoutSitelinksFinder.php
index e4822ef..b5afe58 100644
--- a/repo/includes/Store/Sql/SqlItemsWithoutSitelinksFinder.php
+++ b/repo/includes/Store/Sql/SqlItemsWithoutSitelinksFinder.php
@@ -29,8 +29,6 @@
        }
 
        /**
-        * Return all items without sitelinks.
-        *
         * @param integer $limit Limit of the query.
         * @param integer $offset Offset of the query.
         *
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 626823f..dc2a756 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -1078,8 +1078,6 @@
        }
 
        /**
-        * Returns a SummaryFormatter.
-        *
         * @return SummaryFormatter
         */
        public function getSummaryFormatter() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d8228cff51bae814d1c4c8924b8639417b6e094
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

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

Reply via email to