jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392667 )

Change subject: Fix insufficient type hint in 
LanguageFallbackLabelDescriptionLookupFactory
......................................................................


Fix insufficient type hint in LanguageFallbackLabelDescriptionLookupFactory

You can reproduce the issue by starting here:
DataAccessSnakFormatterFactory::newWikitextSnakFormatter constructs a
UsageTrackingLanguageFallbackLabelDescriptionLookup. That requires a
LanguageFallbackLabelDescriptionLookup because it expects the lookup to
return TermFallback's, and not just Term's. But the current type hint only
guarantees a LabelDescriptionLookup, which is not sufficient.

Or the other way around:
* UsageTrackingLanguageFallbackLabelDescriptionLookup requires the used
  LabelDescriptionLookup to return TermFallback's.
* Therefor it requires a LanguageFallbackLabelDescriptionLookup.
* Therefor LanguageFallbackLabelDescriptionLookupFactory should return a
  LanguageFallbackLabelDescriptionLookup.

Change-Id: Ib6bde2cc01df62a50bbe6b80ec02fcf030f4571f
---
M lib/includes/Store/LanguageFallbackLabelDescriptionLookupFactory.php
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/lib/includes/Store/LanguageFallbackLabelDescriptionLookupFactory.php 
b/lib/includes/Store/LanguageFallbackLabelDescriptionLookupFactory.php
index 87c74c0..c6f05c9 100644
--- a/lib/includes/Store/LanguageFallbackLabelDescriptionLookupFactory.php
+++ b/lib/includes/Store/LanguageFallbackLabelDescriptionLookupFactory.php
@@ -5,7 +5,6 @@
 use InvalidArgumentException;
 use Language;
 use Wikibase\DataModel\Entity\EntityId;
-use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
 use Wikibase\DataModel\Services\Lookup\TermLookup;
 use Wikibase\DataModel\Services\Term\TermBuffer;
 use Wikibase\LanguageFallbackChainFactory;
@@ -74,7 +73,7 @@
         * @param string[] $termTypes Array with one or more of the types 
'label', 'alias' and
         *  'description'. Default is only 'label'.
         *
-        * @return LabelDescriptionLookup
+        * @return LanguageFallbackLabelDescriptionLookup
         */
        public function newLabelDescriptionLookup(
                Language $language,

-- 
To view, visit https://gerrit.wikimedia.org/r/392667
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6bde2cc01df62a50bbe6b80ec02fcf030f4571f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.kr...@wikimedia.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to