@@ -89,7 +89,7 @@ |
||
89 | 89 | /** |
90 | 90 | * @param User $user the user performing the edit |
91 | 91 | * @param EntityId|null $entityId the id of the entity to edit |
92 | - * @param bool|int|null $baseRevId the base revision ID for conflict checking. |
|
92 | + * @param integer $baseRevId the base revision ID for conflict checking. |
|
93 | 93 | * Use 0 to indicate that the current revision should be used as the base revision, |
94 | 94 | * effectively disabling conflict detections. true and false will be accepted for |
95 | 95 | * backwards compatibility, but both will be treated like 0. Note that the behavior |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @param string $termType |
125 | 125 | * @param string $languageCode |
126 | 126 | * |
127 | - * @return string|false|null |
|
127 | + * @return string|null |
|
128 | 128 | */ |
129 | 129 | public function getPrefetchedTerm( EntityId $entityId, $termType, $languageCode ) { |
130 | 130 | $termBuffer = $this->getTermBufferForRepository( $entityId->getRepositoryName() ); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | /** |
153 | 153 | * @param string $repository |
154 | 154 | * |
155 | - * @return TermBuffer|AliasTermBuffer |
|
155 | + * @return TermBuffer|null |
|
156 | 156 | */ |
157 | 157 | private function getTermBufferForRepository( $repository ) { |
158 | 158 | return $this->termBuffers[$repository] ?? null; |
@@ -17,9 +17,9 @@ |
||
17 | 17 | private $buffer; |
18 | 18 | |
19 | 19 | /** |
20 | - * @param array $entityIds |
|
21 | - * @param array|null $termTypes if null, defaults to labels and descriptions only |
|
22 | - * @param array|null $languageCodes if null, defaults to de and en |
|
20 | + * @param \Wikibase\DataModel\Entity\ItemId[] $entityIds |
|
21 | + * @param string[] $termTypes if null, defaults to labels and descriptions only |
|
22 | + * @param string[] $languageCodes if null, defaults to de and en |
|
23 | 23 | */ |
24 | 24 | public function prefetchTerms( array $entityIds, array $termTypes, array $languageCodes ) { |
25 | 25 | if ( $termTypes === null ) { |
@@ -100,8 +100,8 @@ |
||
100 | 100 | * Loads a set of terms into the buffer. |
101 | 101 | * The source from which to fetch would typically be supplied to the buffer's constructor. |
102 | 102 | * @param EntityId[] $entityIds |
103 | - * @param string[]|null $termTypes |
|
104 | - * @param string[]|null $languageCodes |
|
103 | + * @param string[] $termTypes |
|
104 | + * @param string[] $languageCodes |
|
105 | 105 | * |
106 | 106 | * @throws StorageException |
107 | 107 | */ |
@@ -68,8 +68,8 @@ |
||
68 | 68 | * The source from which to fetch would typically be supplied to the buffer's constructor. |
69 | 69 | * |
70 | 70 | * @param EntityId[] $entityIds |
71 | - * @param string[]|null $termTypes The desired term types; null means all. |
|
72 | - * @param string[]|null $languageCodes The desired languages; null means all. |
|
71 | + * @param string[] $termTypes The desired term types; null means all. |
|
72 | + * @param string[] $languageCodes The desired languages; null means all. |
|
73 | 73 | */ |
74 | 74 | public function prefetchTerms( array $entityIds, array $termTypes, array $languageCodes ) { |
75 | 75 | if ( count( $entityIds ) > TermLookupSearcher::MAX_TITLES_PER_QUERY ) { |
@@ -59,8 +59,8 @@ |
||
59 | 59 | * Loads a set of terms into the buffer. |
60 | 60 | * The source from which to fetch would typically be supplied to the buffer's constructor. |
61 | 61 | * @param EntityId[] $entityIds |
62 | - * @param string[]|null $termTypes The desired term types; null means all. |
|
63 | - * @param string[]|null $languageCodes The desired languages; null means all. |
|
62 | + * @param string[] $termTypes The desired term types; null means all. |
|
63 | + * @param string[] $languageCodes The desired languages; null means all. |
|
64 | 64 | */ |
65 | 65 | public function prefetchTerms( array $entityIds, array $termTypes, array $languageCodes ) { |
66 | 66 | Assert::parameterElementType( ItemId::class, $entityIds, '$entityIds' ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param EntityId $entityId |
85 | 85 | * |
86 | 86 | * @throws LabelDescriptionLookupException |
87 | - * @return TermFallback|null |
|
87 | + * @return null|\Wikibase\DataModel\Term\Term |
|
88 | 88 | */ |
89 | 89 | public function getDescription( EntityId $entityId ) { |
90 | 90 | $languageCodes = $this->languageFallbackChain->getFetchLanguageCodes(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param EntityId $entityId |
100 | 100 | * |
101 | 101 | * @throws LabelDescriptionLookupException |
102 | - * @return TermFallback|null |
|
102 | + * @return null|\Wikibase\DataModel\Term\Term |
|
103 | 103 | */ |
104 | 104 | public function getLabel( EntityId $entityId ) { |
105 | 105 | $languageCodes = $this->languageFallbackChain->getFetchLanguageCodes(); |
@@ -109,6 +109,9 @@ discard block |
||
109 | 109 | return $label; |
110 | 110 | } |
111 | 111 | |
112 | + /** |
|
113 | + * @param string $languageCode |
|
114 | + */ |
|
112 | 115 | private function getTerm( EntityId $entityId, $languageCode, $termName = self::LABEL ) { |
113 | 116 | $resolutionResult = $this->redirectResolvingRevisionLookup->lookupLatestRevisionResolvingRedirect( $entityId ); |
114 | 117 | if ( $resolutionResult === null ) { |
@@ -325,6 +325,9 @@ discard block |
||
325 | 325 | $this->assertEquals( $expectedLabel, $gotLabel ); |
326 | 326 | } |
327 | 327 | |
328 | + /** |
|
329 | + * @return RedirectResolvingLatestRevisionLookup |
|
330 | + */ |
|
328 | 331 | private function newRedirectResolvingLatestRevisionLookup( int $revision, EntityId $entityId ) { |
329 | 332 | $revLookup = $this->prophesize( RedirectResolvingLatestRevisionLookup::class ); |
330 | 333 | $revLookup->lookupLatestRevisionResolvingRedirect( Argument::any() ) |
@@ -333,6 +336,9 @@ discard block |
||
333 | 336 | return $revLookup->reveal(); |
334 | 337 | } |
335 | 338 | |
339 | + /** |
|
340 | + * @return LanguageFallbackChain |
|
341 | + */ |
|
336 | 342 | private function newFallbackChain() { |
337 | 343 | $fallbackChain = $this->prophesize( LanguageFallbackChain::class ); |
338 | 344 | $fallbackChain->getFetchLanguageCodes()->willReturn( [ 'en' ] ); |
@@ -171,6 +171,9 @@ |
||
171 | 171 | return $revisionAndRedirectResolver; |
172 | 172 | } |
173 | 173 | |
174 | + /** |
|
175 | + * @return string |
|
176 | + */ |
|
174 | 177 | private function buildTestCacheKey( |
175 | 178 | string $itemId, |
176 | 179 | string $termType, |