[MediaWiki-commits] [Gerrit] Use $this-settings instead of $this-getSettings - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Use $this-settings instead of $this-getSettings .. Use $this-settings instead of $this-getSettings Change-Id: I083a9890f79c4d72f77f8ed7da52e9ed39f0b62e --- M client/includes/WikibaseClient.php 1 file changed, 17 insertions(+), 27 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/WikibaseClient.php b/client/includes/WikibaseClient.php index 0790073..a9b29a5 100644 --- a/client/includes/WikibaseClient.php +++ b/client/includes/WikibaseClient.php @@ -68,7 +68,7 @@ /** * @var PropertyDataTypeLookup */ - public $propertyDataTypeLookup; + private $propertyDataTypeLookup; /** * @var SettingsArray @@ -164,7 +164,7 @@ */ public function getDataTypeFactory() { if ( $this-dataTypeFactory === null ) { - $urlSchemes = $this-getSettings()-getSetting( 'urlSchemes' ); + $urlSchemes = $this-settings-getSetting( 'urlSchemes' ); $builders = new WikibaseDataTypeBuilders( $this-getEntityLookup(), $this-getEntityIdParser(), @@ -277,7 +277,7 @@ if ( $this-store === null ) { $this-store = new DirectSqlStore( $this-getEntityContentDataCodec(), - $this-getContentLanguage(), + $this-contentLanguage, $this-getEntityIdParser(), $repoDatabase ); @@ -476,9 +476,7 @@ $this-getDataTypeFactory() ); - $factory = new OutputFormatSnakFormatterFactory( $builders-getSnakFormatterBuildersForFormats() ); - - return $factory; + return new OutputFormatSnakFormatterFactory( $builders-getSnakFormatterBuildersForFormats() ); } /** @@ -504,9 +502,7 @@ $this-contentLanguage ); - $factory = new OutputFormatValueFormatterFactory( $builders-getValueFormatterBuildersForFormats() ); - - return $factory; + return new OutputFormatValueFormatterFactory( $builders-getValueFormatterBuildersForFormats() ); } /** @@ -514,11 +510,9 @@ */ public function getNamespaceChecker() { if ( !$this-namespaceChecker ) { - $settings = $this-getSettings(); - $this-namespaceChecker = new NamespaceChecker( - $settings-getSetting( 'excludeNamespaces' ), - $settings-getSetting( 'namespaces' ) + $this-settings-getSetting( 'excludeNamespaces' ), + $this-settings-getSetting( 'namespaces' ) ); } @@ -530,12 +524,10 @@ */ public function getLangLinkHandler() { if ( !$this-langLinkHandler ) { - $settings = $this-getSettings(); - $this-langLinkHandler = new LangLinkHandler( $this-getOtherProjectsSidebarGenerator(), $this-getLanguageLinkBadgeDisplay(), - $settings-getSetting( 'siteGlobalID' ), + $this-settings-getSetting( 'siteGlobalID' ), $this-getNamespaceChecker(), $this-getStore()-getSiteLinkTable(), $this-getStore()-getEntityLookup(), @@ -553,7 +545,7 @@ public function getLanguageLinkBadgeDisplay() { global $wgLang; - $badgeClassNames = $this-getSettings()-getSetting( 'badgeClassNames' ); + $badgeClassNames = $this-settings-getSetting( 'badgeClassNames' ); return new LanguageLinkBadgeDisplay( $this-getEntityLookup(), @@ -644,13 +636,11 @@ * @return OtherProjectsSidebarGenerator */ public function getOtherProjectsSidebarGenerator() { - $settings = $this-getSettings(); - return new OtherProjectsSidebarGenerator( - $settings-getSetting( 'siteGlobalID' ), + $this-settings-getSetting( 'siteGlobalID' ), $this-getStore()-getSiteLinkTable(), $this-getSiteStore()-getSites(), - $settings-getSetting( 'otherProjectsLinks' ) + $this-settings-getSetting( 'otherProjectsLinks' ) ); } @@ -678,12 +668,12 @@
[MediaWiki-commits] [Gerrit] Use $this-settings instead of $this-getSettings - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/173262 Change subject: Use $this-settings instead of $this-getSettings .. Use $this-settings instead of $this-getSettings Also see Ib5bb23d. Please merge this patch here first, I will rebase the other later. Change-Id: I083a9890f79c4d72f77f8ed7da52e9ed39f0b62e --- M client/includes/WikibaseClient.php 1 file changed, 34 insertions(+), 44 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/62/173262/1 diff --git a/client/includes/WikibaseClient.php b/client/includes/WikibaseClient.php index c743255..137bb3b 100644 --- a/client/includes/WikibaseClient.php +++ b/client/includes/WikibaseClient.php @@ -15,8 +15,9 @@ use SiteSQLStore; use SiteStore; use ValueFormatters\FormatterOptions; -use Wikibase\Client\Changes\ChangeHandler; use Wikibase\Client\Changes\AffectedPagesFinder; +use Wikibase\Client\Changes\ChangeHandler; +use Wikibase\Client\Changes\WikiPageUpdater; use Wikibase\Client\Hooks\LanguageLinkBadgeDisplay; use Wikibase\Client\Hooks\OtherProjectsSidebarGenerator; use Wikibase\Client\Hooks\ParserFunctionRegistrant; @@ -52,7 +53,6 @@ use Wikibase\Settings; use Wikibase\SettingsArray; use Wikibase\StringNormalizer; -use Wikibase\Client\Changes\WikiPageUpdater; /** * Top level factory for the WikibaseClient extension. @@ -126,14 +126,14 @@ private $valueFormatterFactory; /** -* @var SiteList -*/ - private $siteList = null; - - /** * @var SiteStore */ private $siteStore; + + /** +* @var SiteList|null +*/ + private $siteList = null; /** * @var LangLinkHandler @@ -169,7 +169,7 @@ */ public function getDataTypeFactory() { if ( $this-dataTypeFactory === null ) { - $urlSchemes = $this-getSettings()-getSetting( 'urlSchemes' ); + $urlSchemes = $this-settings-getSetting( 'urlSchemes' ); $builders = new WikibaseDataTypeBuilders( $this-getEntityLookup(), $this-getEntityIdParser(), @@ -481,9 +481,7 @@ $this-getDataTypeFactory() ); - $factory = new OutputFormatSnakFormatterFactory( $builders-getSnakFormatterBuildersForFormats() ); - - return $factory; + return new OutputFormatSnakFormatterFactory( $builders-getSnakFormatterBuildersForFormats() ); } /** @@ -509,9 +507,7 @@ $this-contentLanguage ); - $factory = new OutputFormatValueFormatterFactory( $builders-getValueFormatterBuildersForFormats() ); - - return $factory; + return new OutputFormatValueFormatterFactory( $builders-getValueFormatterBuildersForFormats() ); } /** @@ -519,11 +515,9 @@ */ public function getNamespaceChecker() { if ( !$this-namespaceChecker ) { - $settings = $this-getSettings(); - $this-namespaceChecker = new NamespaceChecker( - $settings-getSetting( 'excludeNamespaces' ), - $settings-getSetting( 'namespaces' ) + $this-settings-getSetting( 'excludeNamespaces' ), + $this-settings-getSetting( 'namespaces' ) ); } @@ -535,12 +529,10 @@ */ public function getLangLinkHandler() { if ( !$this-langLinkHandler ) { - $settings = $this-getSettings(); - $this-langLinkHandler = new LangLinkHandler( $this-getOtherProjectsSidebarGenerator(), $this-getLanguageLinkBadgeDisplay(), - $settings-getSetting( 'siteGlobalID' ), + $this-settings-getSetting( 'siteGlobalID' ), $this-getNamespaceChecker(), $this-getStore()-getSiteLinkTable(), $this-getStore()-getEntityLookup(), @@ -558,24 +550,13 @@ public function getLanguageLinkBadgeDisplay() { global $wgLang; - $badgeClassNames = $this-getSettings()-getSetting( 'badgeClassNames' ); + $badgeClassNames = $this-settings-getSetting( 'badgeClassNames' ); return new LanguageLinkBadgeDisplay( $this-getEntityLookup(), is_array( $badgeClassNames ) ? $badgeClassNames : array(), $wgLang ); - } - - /** -*