mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-13 17:56:59 +00:00
Remove deprecated method hasSite
The method always returns true and has no obvious benefit. Change-Id: I77727d37c16e6234cf13e0ccf5d8fe94142ddd2a
This commit is contained in:
parent
6632c41605
commit
0bec9dc904
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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() );
|
||||
|
|
Loading…
Reference in a new issue