Skip to content

Commit 0eae890

Browse files
thiemowmdeWMDE bot
authored andcommitted
Consistent use of bool/int shortcuts in PHPDoc comments
Two reasons: Consistency. Most of this codebase uses the shortcuts already. It's part of the MediaWiki CodeSniffer rule set. While this particular sniff is currently disabled I would love to enable it at least partially, if possible. This is done in preparation. Change-Id: Ia685c986b6e0036aa3625e302d80b98352079f16
1 parent deff3ba commit 0eae890

9 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/Reference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function getSnaks() {
5858
*
5959
* @since 0.3
6060
*
61-
* @return integer
61+
* @return int
6262
*/
6363
public function count(): int {
6464
return count( $this->snaks );

src/SiteLinkList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function getBySiteId( $siteId ) {
138138
*
139139
* @param string $siteId
140140
*
141-
* @return boolean
141+
* @return bool
142142
* @throws InvalidArgumentException
143143
*/
144144
public function hasLinkWithSiteId( $siteId ) {

src/Snak/Snak.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getHash();
3333

3434
/**
3535
* @param mixed $value
36-
* @return boolean
36+
* @return bool
3737
*/
3838
public function equals( $value );
3939

src/Snak/SnakList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct( $snaks = [] ) {
5151
*
5252
* @param string $snakHash
5353
*
54-
* @return boolean
54+
* @return bool
5555
*/
5656
public function hasSnakHash( $snakHash ) {
5757
return array_key_exists( $snakHash, $this->offsetHashes );
@@ -74,7 +74,7 @@ public function removeSnakHash( $snakHash ) {
7474
*
7575
* @param Snak $snak
7676
*
77-
* @return boolean Indicates if the snak was added or not.
77+
* @return bool Indicates if the snak was added or not.
7878
*/
7979
public function addSnak( Snak $snak ) {
8080
if ( $this->hasSnak( $snak ) ) {
@@ -90,7 +90,7 @@ public function addSnak( Snak $snak ) {
9090
*
9191
* @param Snak $snak
9292
*
93-
* @return boolean
93+
* @return bool
9494
*/
9595
public function hasSnak( Snak $snak ) {
9696
return $this->hasSnakHash( $snak->getHash() );

src/Statement/Statement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function addNewReference( Snak ...$snaks ) {
178178
*
179179
* @since 0.1
180180
*
181-
* @param integer $rank
181+
* @param int $rank
182182
*
183183
* @throws InvalidArgumentException
184184
*/
@@ -195,7 +195,7 @@ public function setRank( int $rank ): void {
195195
/**
196196
* @since 0.1
197197
*
198-
* @return integer
198+
* @return int
199199
*/
200200
public function getRank(): int {
201201
return $this->rank;

src/Statement/StatementFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface StatementFilter {
1313
/**
1414
* @param Statement $statement
1515
*
16-
* @return boolean
16+
* @return bool
1717
*/
1818
public function statementMatches( Statement $statement );
1919

src/Term/AliasGroupList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function isEmpty() {
157157
*
158158
* @param AliasGroup $group
159159
*
160-
* @return boolean
160+
* @return bool
161161
*/
162162
public function hasAliasGroup( AliasGroup $group ) {
163163
return array_key_exists( $group->getLanguageCode(), $this->groups )
@@ -169,7 +169,7 @@ public function hasAliasGroup( AliasGroup $group ) {
169169
*
170170
* @param string $languageCode
171171
*
172-
* @return boolean
172+
* @return bool
173173
*/
174174
public function hasGroupForLanguage( $languageCode ) {
175175
return array_key_exists( $languageCode, $this->groups );

src/Term/Fingerprint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function getLabels() {
7171
*
7272
* @param string $languageCode
7373
*
74-
* @return boolean
74+
* @return bool
7575
*/
7676
public function hasLabel( $languageCode ) {
7777
return $this->labels->hasTermForLanguage( $languageCode );
@@ -125,7 +125,7 @@ public function getDescriptions() {
125125
*
126126
* @param string $languageCode
127127
*
128-
* @return boolean
128+
* @return bool
129129
*/
130130
public function hasDescription( $languageCode ) {
131131
return $this->descriptions->hasTermForLanguage( $languageCode );
@@ -179,7 +179,7 @@ public function getAliasGroups() {
179179
*
180180
* @param string $languageCode
181181
*
182-
* @return boolean
182+
* @return bool
183183
*/
184184
public function hasAliasGroup( $languageCode ) {
185185
return $this->aliasGroups->hasGroupForLanguage( $languageCode );

src/Term/TermList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function isEmpty() {
172172
*
173173
* @param Term $term
174174
*
175-
* @return boolean
175+
* @return bool
176176
*/
177177
public function hasTerm( Term $term ) {
178178
return array_key_exists( $term->getLanguageCode(), $this->terms )

0 commit comments

Comments
 (0)