Remove deprecated method hasSite

The method always returns true and has no obvious benefit.

Change-Id: I77727d37c16e6234cf13e0ccf5d8fe94142ddd2a
This commit is contained in:
Moritz Schubotz (physikerwelt) 2022-07-21 13:06:06 +02:00 committed by Physikerwelt
parent 6632c41605
commit 0bec9dc904
3 changed files with 0 additions and 16 deletions

View file

@ -107,15 +107,6 @@ class MathWikibaseConfig {
return $this->site;
}
/**
* @deprecated Not needed, cannot return anything but true
*
* @return true
*/
public function hasSite() {
return true;
}
/**
* @return PropertyId
*/

View file

@ -234,14 +234,12 @@ class MathWikibaseConnector {
$entityRevision = $entityRevisionLookup->getEntityRevision( $entityId );
$innerEntity = $entityRevision->getEntity();
if ( $innerEntity instanceof Item ) {
if ( $this->config->hasSite() ) {
$site = $this->config->getSite();
$globalID = $site->getGlobalId();
if ( $innerEntity->hasLinkToSite( $globalID ) ) {
$siteLink = $innerEntity->getSiteLink( $globalID );
return $site->getPageUrl( $siteLink->getPageName() );
}
}
}
return false;
} catch ( StorageException $e ) {

View file

@ -56,11 +56,6 @@ class MathWikibaseConfigTest extends MediaWikiUnitTestCase {
$this->assertInstanceOf( 'Wikibase\DataModel\Entity\BasicEntityIdParser', $config->getIdParser() );
}
public function testHasSite() {
$config = $this->getConfig();
$this->assertTrue( $config->hasSite() );
}
public function testGetPropertyIdHasPart() {
$config = $this->getConfig();
$this->assertEquals( 'P1', $config->getPropertyIdHasPart()->getLocalPart() );