Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/377765 )

Change subject: Replace $this->getSettings() with $this->settings
......................................................................

Replace $this->getSettings() with $this->settings

I find it very confusing if half of the code just accesses the private
property, but a few places call the getter that does the exact same.

The getter is for access from the outside.

Bug: T121274
Change-Id: Idbcebe4249fe4221d8f6bc0a6d3170ab1a257319
---
M client/includes/WikibaseClient.php
M repo/includes/WikibaseRepo.php
2 files changed, 13 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/65/377765/1

diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 4b14a38..6d64e00 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -258,10 +258,9 @@
         * @return WikibaseValueFormatterBuilders
         */
        private function newWikibaseValueFormatterBuilders() {
-               $settings = $this->getSettings();
                $entityTitleLookup = new ClientSiteLinkTitleLookup(
                        $this->getStore()->getSiteLinkLookup(),
-                       $settings->getSetting( 'siteGlobalID' )
+                       $this->settings->getSetting( 'siteGlobalID' )
                );
 
                return new WikibaseValueFormatterBuilders(
@@ -269,8 +268,8 @@
                        new FormatterLabelDescriptionLookupFactory( 
$this->getTermLookup() ),
                        new LanguageNameLookup( 
$this->getUserLanguage()->getCode() ),
                        $this->getRepoItemUriParser(),
-                       $settings->getSetting( 'geoShapeStorageBaseUrl' ),
-                       $settings->getSetting( 'tabularDataStorageBaseUrl' ),
+                       $this->settings->getSetting( 'geoShapeStorageBaseUrl' ),
+                       $this->settings->getSetting( 
'tabularDataStorageBaseUrl' ),
                        $entityTitleLookup
                );
        }
@@ -374,7 +373,7 @@
                                $this->repositoryDefinitions,
                                $this->entityTypeDefinitions,
                                $this->getDataAccessSettings(),
-                               $this->getSettings()->getSetting( 
'entityNamespaces' ),
+                               $this->settings->getSetting( 'entityNamespaces' 
),
                                $this->getMultiRepositoryServiceWiring(),
                                $this->getPerRepositoryServiceWiring()
                        );
@@ -384,10 +383,9 @@
        }
 
        private function getDataAccessSettings() {
-               $clientSettings = $this->getSettings();
                return new DataAccessSettings(
-                       $clientSettings->getSetting( 'maxSerializedEntitySize' 
),
-                       $clientSettings->getSetting( 'readFullEntityIdColumn' )
+                       $this->settings->getSetting( 'maxSerializedEntitySize' 
),
+                       $this->settings->getSetting( 'readFullEntityIdColumn' )
                );
        }
 
@@ -846,7 +844,7 @@
         */
        private function getRepoItemUriParser() {
                return new SuffixEntityIdParser(
-                       $this->getSettings()->getSetting( 'repoConceptBaseUri' 
),
+                       $this->settings->getSetting( 'repoConceptBaseUri' ),
                        new ItemIdParser()
                );
        }
@@ -1084,7 +1082,7 @@
                        new SnaksFinder(),
                        $this->getRestrictedEntityLookup(),
                        $this->getDataAccessSnakFormatterFactory(),
-                       $this->getSettings()->getSetting( 
'allowDataAccessInUserLanguage' )
+                       $this->settings->getSetting( 
'allowDataAccessInUserLanguage' )
                );
        }
 
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 85b1e6f..3245270 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -457,8 +457,8 @@
                        new FormatterLabelDescriptionLookupFactory( 
$this->getTermLookup() ),
                        $this->getLanguageNameLookup(),
                        $this->getLocalItemUriParser(),
-                       $this->getSettings()->getSetting( 
'geoShapeStorageBaseUrl' ),
-                       $this->getSettings()->getSetting( 
'tabularDataStorageBaseUrl' ),
+                       $this->settings->getSetting( 'geoShapeStorageBaseUrl' ),
+                       $this->settings->getSetting( 
'tabularDataStorageBaseUrl' ),
                        $this->getEntityTitleLookup()
                );
        }
@@ -1643,14 +1643,14 @@
        public function newPropertyInfoBuilder() {
                $propertyIdMap = [];
 
-               $formatterUrlProperty = $this->getSettings()->getSetting( 
'formatterUrlProperty' );
+               $formatterUrlProperty = $this->settings->getSetting( 
'formatterUrlProperty' );
                if ( $formatterUrlProperty !== null ) {
                        $propertyIdMap[PropertyInfoLookup::KEY_FORMATTER_URL] = 
new PropertyId(
                                $formatterUrlProperty
                        );
                }
 
-               $canonicalUriProperty = $this->getSettings()->getSetting( 
'canonicalUriProperty' );
+               $canonicalUriProperty = $this->settings->getSetting( 
'canonicalUriProperty' );
                if ( $canonicalUriProperty !== null ) {
                        $propertyIdMap[PropertyInfoStore::KEY_CANONICAL_URI] = 
new PropertyId( $canonicalUriProperty );
                }
@@ -2011,7 +2011,7 @@
        }
 
        public function getSettingsValueProvider( $jsSetting, $phpSetting ) {
-               return new SettingsValueProvider( $this->getSettings(), 
$jsSetting, $phpSetting );
+               return new SettingsValueProvider( $this->settings, $jsSetting, 
$phpSetting );
        }
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbcebe4249fe4221d8f6bc0a6d3170ab1a257319
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to