@@ -164,6 +164,9 @@ |
||
164 | 164 | return $existingRecords; |
165 | 165 | } |
166 | 166 | |
167 | + /** |
|
168 | + * @param callable $recordsToInsertDecoratorCallback |
|
169 | + */ |
|
167 | 170 | private function insertNonExistingRecords( |
168 | 171 | array $records, |
169 | 172 | $recordsToInsertDecoratorCallback = null |
@@ -1135,6 +1135,9 @@ |
||
1135 | 1135 | return $conflicts; |
1136 | 1136 | } |
1137 | 1137 | |
1138 | + /** |
|
1139 | + * @param string $entityType |
|
1140 | + */ |
|
1138 | 1141 | private function assertEntityTypeKnown( $entityType ) { |
1139 | 1142 | if ( !in_array( $entityType, $this->entitySource->getEntityTypes() ) ) { |
1140 | 1143 | // TODO: is it really necessary to throw MWException here? |
@@ -73,6 +73,11 @@ discard block |
||
73 | 73 | $formatter->format( new StringValue( 'A string is not a coordinate?!' ) ); |
74 | 74 | } |
75 | 75 | |
76 | + /** |
|
77 | + * @param integer $totalCalls |
|
78 | + * |
|
79 | + * @return CachingKartographerEmbeddingHandler |
|
80 | + */ |
|
76 | 81 | private function newCachingKartographerEmbeddingHandler( |
77 | 82 | $totalCalls, |
78 | 83 | $isPreview = false, |
@@ -96,6 +101,11 @@ discard block |
||
96 | 101 | return $handler; |
97 | 102 | } |
98 | 103 | |
104 | + /** |
|
105 | + * @param integer $expectedFormatCalls |
|
106 | + * |
|
107 | + * @return ValueFormatter |
|
108 | + */ |
|
99 | 109 | private function newBaseValueFormatter( $expectedFormatCalls ) { |
100 | 110 | $formatter = $this->createMock( ValueFormatter::class ); |
101 | 111 |
@@ -412,16 +412,25 @@ discard block |
||
412 | 412 | ); |
413 | 413 | } |
414 | 414 | |
415 | + /** |
|
416 | + * @param string $itemId |
|
417 | + */ |
|
415 | 418 | private function itemPageUrl( $itemId ) { |
416 | 419 | return "/index.php/{$itemId}"; |
417 | 420 | } |
418 | 421 | |
422 | + /** |
|
423 | + * @param string $languageCode |
|
424 | + */ |
|
419 | 425 | private function givenUserLanguageIs( $languageCode ) { |
420 | 426 | $this->setUserLang( $languageCode ); |
421 | 427 | $this->currentUserLanguage = $languageCode; |
422 | 428 | |
423 | 429 | return new class( $this ) extends ItemPropertyIdHtmlLinkFormatterTest { |
424 | 430 | |
431 | + /** |
|
432 | + * @param ItemPropertyIdHtmlLinkFormatterTest $testCase |
|
433 | + */ |
|
425 | 434 | public function __construct( $testCase ) { |
426 | 435 | $this->testCase = $testCase; |
427 | 436 | } |
@@ -430,6 +439,9 @@ discard block |
||
430 | 439 | $this->testCase->fallbackChain = $languageCodes; |
431 | 440 | } |
432 | 441 | |
442 | + /** |
|
443 | + * @param string $anotherLanguage |
|
444 | + */ |
|
433 | 445 | public function canBeTransliteratedFrom( $anotherLanguage ) { |
434 | 446 | $this->testCase->transliterationMap[ $anotherLanguage ] = $this->testCase->currentUserLanguage; |
435 | 447 | } |
@@ -437,6 +449,11 @@ discard block |
||
437 | 449 | }; |
438 | 450 | } |
439 | 451 | |
452 | + /** |
|
453 | + * @param string $itemId |
|
454 | + * @param string $labelLanguage |
|
455 | + * @param string $labelText |
|
456 | + */ |
|
440 | 457 | private function givenItemHasLabel( $itemId, $labelLanguage, $labelText ) { |
441 | 458 | $this->givenItemExists( 'Q1' ); |
442 | 459 | |
@@ -542,12 +559,20 @@ discard block |
||
542 | 559 | }; |
543 | 560 | } |
544 | 561 | |
562 | + /** |
|
563 | + * @param string $propertyId |
|
564 | + * @param string $labelLanguage |
|
565 | + * @param string $labelText |
|
566 | + */ |
|
545 | 567 | private function givenPropertyHasLabel( $propertyId, $labelLanguage, $labelText ) { |
546 | 568 | $this->givenPropertyExists( 'P1' ); |
547 | 569 | |
548 | 570 | $this->givenEntityHasLabel( new PropertyId( $propertyId ), $labelLanguage, $labelText ); |
549 | 571 | } |
550 | 572 | |
573 | + /** |
|
574 | + * @param string $propertyId |
|
575 | + */ |
|
551 | 576 | private function propertyPageUrl( $propertyId ) { |
552 | 577 | return "/index.php/Property:{$propertyId}"; |
553 | 578 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | * |
225 | 225 | * @param EntityDocument $entity |
226 | 226 | * @param int $revisionId |
227 | - * @param int|string $timestamp |
|
227 | + * @param integer $timestamp |
|
228 | 228 | * @param User|string|null $user |
229 | 229 | * |
230 | 230 | * @throws StorageException |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * |
288 | 288 | * @param EntityRedirect $redirect |
289 | 289 | * @param int $revisionId |
290 | - * @param string|int $timestamp |
|
290 | + * @param integer $timestamp |
|
291 | 291 | * |
292 | 292 | * @throws StorageException |
293 | 293 | */ |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | /** |
642 | 642 | * @param string $idString |
643 | 643 | * |
644 | - * @return ItemId|PropertyId |
|
644 | + * @return EntityId |
|
645 | 645 | */ |
646 | 646 | private function parseId( $idString ) { |
647 | 647 | $parser = new BasicEntityIdParser(); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | |
651 | 651 | /** |
652 | 652 | * @param int $revisionId |
653 | - * @param EntityId|string $entityId |
|
653 | + * @param EntityId $entityId |
|
654 | 654 | * @param string $summary |
655 | 655 | * @param User|string $user |
656 | 656 | * @param string[] $tags |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | * Returns the newest (according to the revision id) log entry |
690 | 690 | * for the given entity. |
691 | 691 | * |
692 | - * @param EntityId|string $entityId |
|
692 | + * @param ItemId $entityId |
|
693 | 693 | * |
694 | 694 | * @return array|null An associative array containing the fields |
695 | 695 | * 'revision', 'entity', 'summary', 'user', and 'tags'. |
@@ -57,6 +57,9 @@ discard block |
||
57 | 57 | ); |
58 | 58 | } |
59 | 59 | |
60 | + /** |
|
61 | + * @return EntityDocument |
|
62 | + */ |
|
60 | 63 | private function newUnsupportedEntity() { |
61 | 64 | return $this->createMock( EntityDocument::class ); |
62 | 65 | } |
@@ -68,6 +71,9 @@ discard block |
||
68 | 71 | $writer->deleteTermsOfEntity( $this->newUnsupportedId() ); |
69 | 72 | } |
70 | 73 | |
74 | + /** |
|
75 | + * @return EntityId |
|
76 | + */ |
|
71 | 77 | public function newUnsupportedId() { |
72 | 78 | return $this->createMock( EntityId::class ); |
73 | 79 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | class DispatchingEntityRevisionLookupTest extends \PHPUnit\Framework\TestCase { |
24 | 24 | |
25 | 25 | /** |
26 | - * @return MockObject|EntityRevisionLookup |
|
26 | + * @return \Wikibase\DataModel\Entity\EntityDocument |
|
27 | 27 | */ |
28 | 28 | private function getDummyEntityRevisionLookup() { |
29 | 29 | return $this->createMock( EntityRevisionLookup::class ); |
@@ -19,7 +19,6 @@ |
||
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @param string $lang |
22 | - * @param TermIndexEntry[] $terms |
|
23 | 22 | * |
24 | 23 | * @return PropertyLabelResolver |
25 | 24 | */ |
@@ -827,6 +827,12 @@ discard block |
||
827 | 827 | return $entities; |
828 | 828 | } |
829 | 829 | |
830 | + /** |
|
831 | + * @param string $id |
|
832 | + * @param string $languageCode |
|
833 | + * @param string $label |
|
834 | + * @param string $description |
|
835 | + */ |
|
830 | 836 | private function makeTermConflictItem( $id, $languageCode, $label, $description ) { |
831 | 837 | $item = new Item( new ItemId( $id ) ); |
832 | 838 | $item->setLabel( $languageCode, $label ); |
@@ -1993,6 +1999,9 @@ discard block |
||
1993 | 1999 | $fooTermIndex->getLabelWithDescriptionConflicts( 'property', [ 'en' => 'some irrelevant label' ], [ 'en' => 'random description' ] ); |
1994 | 2000 | } |
1995 | 2001 | |
2002 | + /** |
|
2003 | + * @param string $entityType |
|
2004 | + */ |
|
1996 | 2005 | private function getTermSqlIndexForSourceOf( $entityType ) { |
1997 | 2006 | $irrelevantNamespaceId = 100; |
1998 | 2007 |