Skip to content

Commit faeca74

Browse files
thiemowmdeWMDE bot
authored andcommitted
Fix and enable FunctionComment.MissingReturn PHPCS rule
It looks like this is worth it. There are not that many issues found, which implies that almost all of this codebase was already following this rule. I tried to apply the most minimal fixes as well as reduce duplication by utilizing the @inheritdoc feature. It effectively marks a method as "intentionally undocumented". Change-Id: I394ad1fc9b918b0b7896bb47d60723587e174f83
1 parent 1b250c4 commit faeca74

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

tests/unit/NewItem.php

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NewItem {
3131
private $descriptions = [];
3232

3333
/**
34-
* @var array[] Indexed by language on the first level
34+
* @var array<string,string[]> Indexed by language code on the first level
3535
*/
3636
private $aliases = [];
3737

@@ -86,15 +86,15 @@ public function build() {
8686
}
8787

8888
/**
89-
* @see andId
89+
* @param ItemId|string $itemId
90+
* @return self
9091
*/
9192
public static function withId( $itemId ) {
9293
return ( new self() )->andId( $itemId );
9394
}
9495

9596
/**
9697
* @param ItemId|string $itemId
97-
*
9898
* @return self
9999
*/
100100
public function andId( $itemId ) {
@@ -107,7 +107,9 @@ public function andId( $itemId ) {
107107
}
108108

109109
/**
110-
* @see andLabel
110+
* @param string $languageCode
111+
* @param string $label
112+
* @return self
111113
*/
112114
public static function withLabel( $languageCode, $label ) {
113115
return ( new self() )->andLabel( $languageCode, $label );
@@ -116,7 +118,6 @@ public static function withLabel( $languageCode, $label ) {
116118
/**
117119
* @param string $languageCode
118120
* @param string $label
119-
*
120121
* @return self
121122
*/
122123
public function andLabel( $languageCode, $label ) {
@@ -126,7 +127,9 @@ public function andLabel( $languageCode, $label ) {
126127
}
127128

128129
/**
129-
* @see andDescription
130+
* @param string $languageCode
131+
* @param string $description
132+
* @return self
130133
*/
131134
public static function withDescription( $languageCode, $description ) {
132135
return ( new self() )->andDescription( $languageCode, $description );
@@ -135,7 +138,6 @@ public static function withDescription( $languageCode, $description ) {
135138
/**
136139
* @param string $languageCode
137140
* @param string $description
138-
*
139141
* @return self
140142
*/
141143
public function andDescription( $languageCode, $description ) {
@@ -145,7 +147,9 @@ public function andDescription( $languageCode, $description ) {
145147
}
146148

147149
/**
148-
* @see andAliases
150+
* @param string $languageCode
151+
* @param string[]|string $aliases
152+
* @return self
149153
*/
150154
public static function withAliases( $languageCode, $aliases ) {
151155
return ( new self() )->andAliases( $languageCode, $aliases );
@@ -154,7 +158,6 @@ public static function withAliases( $languageCode, $aliases ) {
154158
/**
155159
* @param string $languageCode
156160
* @param string[]|string $aliases
157-
*
158161
* @return self
159162
*/
160163
public function andAliases( $languageCode, $aliases ) {
@@ -164,7 +167,11 @@ public function andAliases( $languageCode, $aliases ) {
164167
}
165168

166169
/**
167-
* @see andSiteLink
170+
* @param string $siteId
171+
* @param string $pageName
172+
* @param ItemId[]|string[]|ItemId|string|null $badges Zero or more item ID references as either
173+
* strings or ItemId objects. Can be an array or a single value.
174+
* @return self
168175
*/
169176
public static function withSiteLink( $siteId, $pageName, $badges = null ) {
170177
return ( new self() )->andSiteLink( $siteId, $pageName, $badges );
@@ -175,7 +182,6 @@ public static function withSiteLink( $siteId, $pageName, $badges = null ) {
175182
* @param string $pageName
176183
* @param ItemId[]|string[]|ItemId|string|null $badges Zero or more item ID references as either
177184
* strings or ItemId objects. Can be an array or a single value.
178-
*
179185
* @return self
180186
*/
181187
public function andSiteLink( $siteId, $pageName, $badges = null ) {
@@ -190,15 +196,15 @@ public function andSiteLink( $siteId, $pageName, $badges = null ) {
190196
}
191197

192198
/**
193-
* @see andStatement
199+
* @param NewStatement|Statement|Snak $statement
200+
* @return self
194201
*/
195202
public static function withStatement( $statement ) {
196203
return ( new self() )->andStatement( $statement );
197204
}
198205

199206
/**
200207
* @param NewStatement|Statement|Snak $statement
201-
*
202208
* @return self
203209
*/
204210
public function andStatement( $statement ) {

0 commit comments

Comments
 (0)