The expression return $this->lookup->getEntity($itemId) also could return the type Wikibase\DataModel\Entity\EntityDocument which includes types incompatible with the return type mandated by Wikibase\DataModel\Servi...mLookup::getItemForId() of Wikibase\DataModel\Entity\Item|null. Consider adding a type-check to rule them out.
Loading history...
32
} catch ( EntityLookupException $ex ) {
33
throw new ItemLookupException( $itemId, $ex->getMessage(), $ex );