@@ -7,7 +7,6 @@ |
||
7 | 7 | use Html; |
8 | 8 | use PageImages\PageImages; |
9 | 9 | use Title; |
10 | - |
|
11 | 10 | use Wikibase\Client\RepoLinker; |
12 | 11 | use Wikibase\Client\WikibaseClient; |
13 | 12 | use Wikibase\DataModel\Entity\EntityDocument; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * @return RecentChangesFinder|MockObject |
|
90 | + * @return RecentChangesFinder |
|
91 | 91 | */ |
92 | 92 | private function getRCDupeDetectorMock() { |
93 | 93 | $rcDupeDetector = $this->getMockBuilder( RecentChangesFinder::class ) |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param string $text |
118 | 118 | * @param int $id |
119 | 119 | * |
120 | - * @return Title|MockObject |
|
120 | + * @return \Wikibase\DataModel\Entity\EntityId |
|
121 | 121 | */ |
122 | 122 | private function getTitleMock( $text, $id = 23 ) { |
123 | 123 | $title = $this->getMockBuilder( Title::class ) |
@@ -26,6 +26,9 @@ |
||
26 | 26 | yield 'default not matching type' => [ false, EntityUrlLookup::class, [], new stdClass() ]; |
27 | 27 | } |
28 | 28 | |
29 | + /** |
|
30 | + * @param stdClass $fakeServiceToReturn |
|
31 | + */ |
|
29 | 32 | private function getSomeServiceReturningCallback( $fakeServiceToReturn = null ) { |
30 | 33 | return function () use ( $fakeServiceToReturn ) { |
31 | 34 | return $fakeServiceToReturn ?? new stdClass(); |
@@ -335,7 +335,7 @@ |
||
335 | 335 | * @param Title|null $currentTitle |
336 | 336 | * @param RequestContext $context |
337 | 337 | * |
338 | - * @return bool |
|
338 | + * @return null|boolean |
|
339 | 339 | */ |
340 | 340 | private function shouldConvert( ?Title $currentTitle, RequestContext $context ) { |
341 | 341 | static $shouldConvert = null; |
@@ -170,6 +170,7 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @param int $ns Namespace ID |
172 | 172 | * @param bool &$movable |
173 | + * @param boolean $movable |
|
173 | 174 | */ |
174 | 175 | public static function onNamespaceIsMovable( $ns, &$movable ) { |
175 | 176 | if ( self::isNamespaceUsedByLocalEntities( $ns ) ) { |
@@ -177,6 +178,9 @@ discard block |
||
177 | 178 | } |
178 | 179 | } |
179 | 180 | |
181 | + /** |
|
182 | + * @param integer $namespace |
|
183 | + */ |
|
180 | 184 | private static function isNamespaceUsedByLocalEntities( $namespace ) { |
181 | 185 | $wikibaseRepo = WikibaseRepo::getDefaultInstance(); |
182 | 186 | $namespaceLookup = $wikibaseRepo->getEntityNamespaceLookup(); |
@@ -774,6 +778,7 @@ discard block |
||
774 | 778 | * @param string $contentModel |
775 | 779 | * @param LinkTarget $title Actually a Title object, but we only require getNamespace |
776 | 780 | * @param bool &$ok |
781 | + * @param boolean $ok |
|
777 | 782 | * |
778 | 783 | * @return bool |
779 | 784 | */ |
@@ -852,7 +857,7 @@ discard block |
||
852 | 857 | /** |
853 | 858 | * Helper for onAPIQuerySiteInfoStatisticsInfo |
854 | 859 | * |
855 | - * @param object $row |
|
860 | + * @param \stdClass|null $row |
|
856 | 861 | * @return array |
857 | 862 | */ |
858 | 863 | private static function formatDispatchRow( $row ) { |
@@ -111,6 +111,9 @@ discard block |
||
111 | 111 | ->getEntityParserOutputGenerator( Language::factory( 'en' ) ); |
112 | 112 | } |
113 | 113 | |
114 | + /** |
|
115 | + * @param string $id |
|
116 | + */ |
|
114 | 117 | private function saveItem( $id ) { |
115 | 118 | $this->entityStore->saveEntity( |
116 | 119 | new Item( new ItemId( $id ) ), |
@@ -119,6 +122,9 @@ discard block |
||
119 | 122 | ); |
120 | 123 | } |
121 | 124 | |
125 | + /** |
|
126 | + * @param string $id |
|
127 | + */ |
|
122 | 128 | private function saveProperty( $id ) { |
123 | 129 | $this->entityStore->saveEntity( |
124 | 130 | new Property( new PropertyId( $id ), null, 'wikibase-item' ), |
@@ -55,6 +55,9 @@ discard block |
||
55 | 55 | return new ApiEntitySearchHelper( $api, $dataTypes ); |
56 | 56 | } |
57 | 57 | |
58 | + /** |
|
59 | + * @param string $responseDataFile |
|
60 | + */ |
|
58 | 61 | private function setupTestApi( &$params, $langCode, $responseDataFile, $statusCode = 200 ) { |
59 | 62 | $params = array_merge( $params, [ 'language' => $langCode, 'uselang' => $langCode, 'format' => 'json' ] ); |
60 | 63 | $api = $this->createMock( GenericActionApiClient::class ); |
@@ -151,8 +154,8 @@ discard block |
||
151 | 154 | /** |
152 | 155 | * @dataProvider paramsAndExpectedResponseProvider |
153 | 156 | * @param string $responseDataFile |
154 | - * @param int $expectedResultCount |
|
155 | - * @param array $expectedResultsEntityId |
|
157 | + * @param int $expectedResultsEntityIds |
|
158 | + * @param array $expectedResultsEntityIds |
|
156 | 159 | * @throws ApiRequestException |
157 | 160 | */ |
158 | 161 | public function testGetRankedSearchResults( $langCode, $params, $responseDataFile, $expectedResultsEntityIds ) { |
@@ -219,6 +222,9 @@ discard block |
||
219 | 222 | } |
220 | 223 | } |
221 | 224 | |
225 | + /** |
|
226 | + * @param integer $statusCode |
|
227 | + */ |
|
222 | 228 | private function newMockResponse( $responseDataFile, $statusCode ) { |
223 | 229 | $mwResponse = $this->createMock( ResponseInterface::class ); |
224 | 230 | $mwResponse->expects( $this->any() ) |
@@ -246,8 +252,6 @@ discard block |
||
246 | 252 | /** |
247 | 253 | * @dataProvider invalidParamsAndUnexpectedResponseProvider |
248 | 254 | * @param string $responseDataFile |
249 | - * @param int $expectedResultCount |
|
250 | - * @param array $expectedResultsEntityId |
|
251 | 255 | */ |
252 | 256 | public function testApiResponseStructureIsValid( $langCode, $params, $responseDataFile, $statusCode ) { |
253 | 257 | $api = $this->setupTestApi( $params, $langCode, $responseDataFile, $statusCode ); |
@@ -127,7 +127,6 @@ |
||
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
130 | - * @param Title $title |
|
131 | 130 | * @param array|null $currentUsages |
132 | 131 | * |
133 | 132 | * @return UsageLookup |
@@ -65,6 +65,8 @@ |
||
65 | 65 | * @param array &$query_options Array of options for the database request |
66 | 66 | * @param array &$join_conds Join conditions for the tables |
67 | 67 | * @param \FormOptions $opts FormOptions for this request |
68 | + * @param string[] $tables |
|
69 | + * @param string[] $fields |
|
68 | 70 | */ |
69 | 71 | public function onChangesListSpecialPageQuery( $name, &$tables, &$fields, |
70 | 72 | &$conds, &$query_options, &$join_conds, $opts ) { |