@@ -122,6 +122,9 @@ discard block |
||
122 | 122 | $redirectRows ); |
123 | 123 | } |
124 | 124 | |
125 | + /** |
|
126 | + * @param string $termType |
|
127 | + */ |
|
125 | 128 | private function getTermRows( EntityId $id, $termType, $terms ) { |
126 | 129 | $rows = []; |
127 | 130 | |
@@ -169,6 +172,9 @@ discard block |
||
169 | 172 | return $page; |
170 | 173 | } |
171 | 174 | |
175 | + /** |
|
176 | + * @param string $table |
|
177 | + */ |
|
172 | 178 | private function insertRows( $table, array $fields, array $rows ) { |
173 | 179 | $dbw = wfGetDB( DB_MASTER ); |
174 | 180 | |
@@ -219,7 +225,7 @@ discard block |
||
219 | 225 | } |
220 | 226 | |
221 | 227 | /** |
222 | - * @return \PHPUnit\Framework\MockObject\MockObject|CacheInterface |
|
228 | + * @return CacheInterface |
|
223 | 229 | */ |
224 | 230 | private function getCache() { |
225 | 231 | $mock = $this->createMock( CacheInterface::class ); |
@@ -307,6 +313,11 @@ discard block |
||
307 | 313 | $this->assertFalse( $entityInfo->hasEntityInfo( $propertyId ) ); |
308 | 314 | } |
309 | 315 | |
316 | + /** |
|
317 | + * @param string $termType |
|
318 | + * @param string $termLanguage |
|
319 | + * @param string $termText |
|
320 | + */ |
|
310 | 321 | private function saveFakeForeignItemTermUsingFullItemId( ItemId $itemId, $termType, $termLanguage, $termText ) { |
311 | 322 | // Insert any existing data for the item ID (might collide because of insert done in setUp |
312 | 323 | $db = wfGetDB( DB_MASTER ); |
@@ -714,6 +714,9 @@ |
||
714 | 714 | ); |
715 | 715 | } |
716 | 716 | |
717 | + /** |
|
718 | + * @param integer $langCount |
|
719 | + */ |
|
717 | 720 | private function generateLanguageValuePairs( $langCount ) { |
718 | 721 | $result = []; |
719 | 722 | $langCodes = WikibaseRepo::getDefaultInstance()->getTermsLanguages()->getLanguages(); |
@@ -201,6 +201,9 @@ discard block |
||
201 | 201 | return $page; |
202 | 202 | } |
203 | 203 | |
204 | + /** |
|
205 | + * @param string $table |
|
206 | + */ |
|
204 | 207 | private function insertRows( $table, array $fields, array $rows ) { |
205 | 208 | $dbw = wfGetDB( DB_MASTER ); |
206 | 209 | |
@@ -267,7 +270,7 @@ discard block |
||
267 | 270 | } |
268 | 271 | |
269 | 272 | /** |
270 | - * @return \PHPUnit\Framework\MockObject\MockObject|CacheInterface |
|
273 | + * @return CacheInterface |
|
271 | 274 | */ |
272 | 275 | private function getCache() { |
273 | 276 | $mock = $this->createMock( CacheInterface::class ); |
@@ -25,6 +25,9 @@ |
||
25 | 25 | $this->termValidatorFactory = $termValidatorFactory; |
26 | 26 | } |
27 | 27 | |
28 | + /** |
|
29 | + * @param NullChangeOp $changeOps |
|
30 | + */ |
|
28 | 31 | public function add( $changeOps ) { |
29 | 32 | $this->innerChangeOps->add( $changeOps ); |
30 | 33 | } |
@@ -53,6 +53,9 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @param ChangeOpFingerprintResult $value |
|
58 | + */ |
|
56 | 59 | private function validateProperty( $value ) { |
57 | 60 | if ( $this->propertyTermsMigrationStage > MIGRATION_WRITE_BOTH ) { |
58 | 61 | return $this->fingerprintUniquenessValidator->validate( $value ); |
@@ -61,6 +64,9 @@ discard block |
||
61 | 64 | return Result::newSuccess(); |
62 | 65 | } |
63 | 66 | |
67 | + /** |
|
68 | + * @param ChangeOpFingerprintResult $value |
|
69 | + */ |
|
64 | 70 | private function validateItem( $value, ItemId $itemId ) { |
65 | 71 | $entityNumericId = $itemId->getNumericId(); |
66 | 72 | foreach ( $this->itemTermsMigrationStages as $maxId => $migrationStage ) { |
@@ -213,6 +213,9 @@ discard block |
||
213 | 213 | } |
214 | 214 | } |
215 | 215 | |
216 | + /** |
|
217 | + * @param string|false $termType |
|
218 | + */ |
|
216 | 219 | private function getEntityTerm( EntityId $entityId, $lang, $termType ): string { |
217 | 220 | if ( $termType === 'label' ) { |
218 | 221 | return $this->termLookup->getLabel( $entityId, $lang ) ?? ''; |
@@ -223,6 +226,10 @@ discard block |
||
223 | 226 | throw new InvalidArgumentException( "\$termType can only be 'label' or 'property'. '{$termType}' was given" ); |
224 | 227 | } |
225 | 228 | |
229 | + /** |
|
230 | + * @param string $code |
|
231 | + * @param EntityId $collidingEntityId |
|
232 | + */ |
|
226 | 233 | private function collisionToError( $code, $collidingEntityId, $lang, $label ) { |
227 | 234 | return new UniquenessViolation( |
228 | 235 | $collidingEntityId, |
@@ -103,6 +103,10 @@ discard block |
||
103 | 103 | $this->assertSame( $expected, $entityContent->getTextForSearchIndex() ); |
104 | 104 | } |
105 | 105 | |
106 | + /** |
|
107 | + * @param string $languageCode |
|
108 | + * @param string $text |
|
109 | + */ |
|
106 | 110 | private function setLabel( EntityDocument $entity, $languageCode, $text ) { |
107 | 111 | if ( !( $entity instanceof LabelsProvider ) ) { |
108 | 112 | throw new InvalidArgumentException( '$entity must be a LabelsProvider' ); |
@@ -462,6 +466,9 @@ discard block |
||
462 | 466 | $this->assertDataUpdates( $updates ); |
463 | 467 | } |
464 | 468 | |
469 | + /** |
|
470 | + * @param \Wikibase\Repo\Content\DataUpdateAdapter[] $updates |
|
471 | + */ |
|
465 | 472 | private function assertDataUpdates( $updates ) { |
466 | 473 | $this->assertIsArray( $updates ); |
467 | 474 | $this->assertContainsOnlyInstancesOf( 'DataUpdate', $updates ); |
@@ -212,6 +212,9 @@ |
||
212 | 212 | return $titleLookup; |
213 | 213 | } |
214 | 214 | |
215 | + /** |
|
216 | + * @return string |
|
217 | + */ |
|
215 | 218 | private function executeSpecialMergeItems( $params, User $user = null ) { |
216 | 219 | if ( !$user ) { |
217 | 220 | // TODO Matching the token of a non-anonymous user is complicated. |
@@ -151,6 +151,9 @@ |
||
151 | 151 | ); |
152 | 152 | } |
153 | 153 | |
154 | + /** |
|
155 | + * @return string |
|
156 | + */ |
|
154 | 157 | private function executeSpecialEntityRedirect( array $params, User $user = null ) { |
155 | 158 | if ( !$user ) { |
156 | 159 | // TODO Matching the token of a non-anonymous user is complicated. |