@@ -646,6 +646,9 @@ discard block |
||
| 646 | 646 | return $revisionAndRedirectResolver; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | + /** |
|
| 650 | + * @return string |
|
| 651 | + */ |
|
| 649 | 652 | private function buildTestCacheKey( |
| 650 | 653 | string $itemId, |
| 651 | 654 | string $termType, |
@@ -663,6 +666,9 @@ discard block |
||
| 663 | 666 | return $mockCache; |
| 664 | 667 | } |
| 665 | 668 | |
| 669 | + /** |
|
| 670 | + * @param boolean $fillValue |
|
| 671 | + */ |
|
| 666 | 672 | private function newMockCacheExpectingKeys( array $expectedCacheKeys, $fillValue = null ): CacheInterface { |
| 667 | 673 | $cache = $this->createMock( CacheInterface::class ); |
| 668 | 674 | $cache->expects( $this->once() ) |
@@ -68,6 +68,9 @@ |
||
| 68 | 68 | ] ); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | + /** |
|
| 72 | + * @param Statement $statement |
|
| 73 | + */ |
|
| 71 | 74 | private function getSerializedStatement( $statement ) { |
| 72 | 75 | $statementSerializer = ( new SerializerFactory( new DataValueSerializer() ) )->newStatementSerializer(); |
| 73 | 76 | return $statementSerializer->serialize( $statement ); |
@@ -23,6 +23,9 @@ |
||
| 23 | 23 | $this->setWbSetting( 'federatedPropertiesEnabled', true ); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string|boolean $value |
|
| 28 | + */ |
|
| 26 | 29 | private function setWbSetting( string $name, $value ) { |
| 27 | 30 | $this->setWbSettingInGlobalIfMwIntegrationTest( $name, $value ); |
| 28 | 31 | $this->setWbSettingInSettings( $name, $value ); |
@@ -21,6 +21,7 @@ |
||
| 21 | 21 | * @param LabelsProvider $entity |
| 22 | 22 | * @param string $msg Message key (string) for error text |
| 23 | 23 | * @param array $params Array with parameters to wfMessage() |
| 24 | + * @param string|null $languageCode |
|
| 24 | 25 | * |
| 25 | 26 | * @suppress SecurityCheck-DoubleEscaped |
| 26 | 27 | */ |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @param IResultWrapper|array $rows |
| 37 | - * @param array $languageCodes |
|
| 37 | + * @param string[] $languageCodes |
|
| 38 | 38 | * @param array $termTypes |
| 39 | 39 | */ |
| 40 | 40 | public function prefetchFederatedProperties( $rows, array $languageCodes, array $termTypes ) : void { |
@@ -182,6 +182,9 @@ |
||
| 182 | 182 | return $rows; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | + /** |
|
| 186 | + * @param string $titleText |
|
| 187 | + */ |
|
| 185 | 188 | private function getMockedDiffEngine( $getOldRevision, $getNewRevision, $titleText ) { |
| 186 | 189 | $diffEngine = $this->createMock( DifferenceEngine::class ); |
| 187 | 190 | $diffEngine->expects( $this->once() ) |
@@ -55,7 +55,6 @@ discard block |
||
| 55 | 55 | * @param string[] $termTypes |
| 56 | 56 | * @param string[] $languageCodes |
| 57 | 57 | * @param PrefetchingTermLookup|null $prefetchingTermLookup |
| 58 | - * @param EntityLookup|null $entityLookup |
|
| 59 | 58 | * @param bool $federatedPropertiesEnabled |
| 60 | 59 | * @return LabelPrefetchHookHandler |
| 61 | 60 | */ |
@@ -103,6 +102,10 @@ discard block |
||
| 103 | 102 | ); |
| 104 | 103 | } |
| 105 | 104 | |
| 105 | + /** |
|
| 106 | + * @param string[] $expectedTermTypes |
|
| 107 | + * @param string[] $expectedLanguageCodes |
|
| 108 | + */ |
|
| 106 | 109 | protected function getPrefetchTermsCallback( $expectedIds, $expectedTermTypes, $expectedLanguageCodes ) { |
| 107 | 110 | $prefetchTerms = function ( |
| 108 | 111 | array $entityIds, |
@@ -155,6 +155,9 @@ discard block |
||
| 155 | 155 | ]; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | + /** |
|
| 159 | + * @param PropertyId[] $expectedIds |
|
| 160 | + */ |
|
| 158 | 161 | protected function getPrefetchTermsCallback( $expectedIds ) { |
| 159 | 162 | $prefetchTerms = function ( |
| 160 | 163 | array $entityIds, |
@@ -178,6 +181,9 @@ discard block |
||
| 178 | 181 | return $prefetchTerms; |
| 179 | 182 | } |
| 180 | 183 | |
| 184 | + /** |
|
| 185 | + * @param FullEntityParserOutputGenerator $fullGenerator |
|
| 186 | + */ |
|
| 181 | 187 | private function newEntityParserOutputGenerator( $prefetchingTermLookup, $fullGenerator, $languageCode = 'en' ) { |
| 182 | 188 | return new FederatedPropertiesEntityParserOutputGenerator( |
| 183 | 189 | $fullGenerator, |
@@ -1071,6 +1071,10 @@ discard block |
||
| 1071 | 1071 | $this->invokeMethodIfNoRequiredParameters( $wbRepo, $reflectionClass->getMethod( $methodName ) ); |
| 1072 | 1072 | } |
| 1073 | 1073 | |
| 1074 | + /** |
|
| 1075 | + * @param WikibaseRepo $wbRepo |
|
| 1076 | + * @param ReflectionMethod $method |
|
| 1077 | + */ |
|
| 1074 | 1078 | private function invokeMethodIfNoRequiredParameters( $wbRepo, $method ) { |
| 1075 | 1079 | if ( $method->getNumberOfRequiredParameters() === 0 ) { |
| 1076 | 1080 | $method->invoke( $wbRepo ); |
@@ -1086,6 +1090,10 @@ discard block |
||
| 1086 | 1090 | ); |
| 1087 | 1091 | } |
| 1088 | 1092 | |
| 1093 | + /** |
|
| 1094 | + * @param string $settingName |
|
| 1095 | + * @param boolean $settingValue |
|
| 1096 | + */ |
|
| 1089 | 1097 | private function getSettingsCopyWithSettingSet( $settingName, $settingValue ) { |
| 1090 | 1098 | $settings = new SettingsArray( WikibaseRepo::getDefaultInstance()->getSettings()->getArrayCopy() ); |
| 1091 | 1099 | $settings->setSetting( $settingName, $settingValue ); |