Jeroen De Dauw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/69977
Change subject: Remove Settings::newFromGlobals
......................................................................
Remove Settings::newFromGlobals
Change-Id: I29340093b7141b10498d2d1eaffb8125d6c9a224
---
M includes/Settings.php
M includes/rows/EPRevision.php
M tests/phpunit/ExtensionTest.php
3 files changed, 4 insertions(+), 15 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram
refs/changes/77/69977/1
diff --git a/includes/Settings.php b/includes/Settings.php
index 34e1630..e3aad6a 100644
--- a/includes/Settings.php
+++ b/includes/Settings.php
@@ -31,19 +31,6 @@
class Settings {
/**
- * Constructs a new instance of the settings object from global state.
- *
- * @since 0.3
- *
- * @param array $globalVariables
- *
- * @return Settings
- */
- public static function newFromGlobals( array $globalVariables ) {
- return new self( $globalVariables['egEPSettings'] );
- }
-
- /**
* @since 0.3
*
* @var array
@@ -89,7 +76,7 @@
static $settings = null;
if ( $settings === null ) {
- $settings = static::newFromGlobals( $GLOBALS );
+ $settings = new self( $GLOBALS['egEPSettings'] );
}
return $settings->getSetting( $settingName );
diff --git a/includes/rows/EPRevision.php b/includes/rows/EPRevision.php
index 3d69c36..281d241 100644
--- a/includes/rows/EPRevision.php
+++ b/includes/rows/EPRevision.php
@@ -47,6 +47,8 @@
$tableClass = $map[$tableClass];
+
+
return $tableClass::singleton()->newRow( $this->getField(
'data' ), true );
}
diff --git a/tests/phpunit/ExtensionTest.php b/tests/phpunit/ExtensionTest.php
index 6cc82bc..369f592 100644
--- a/tests/phpunit/ExtensionTest.php
+++ b/tests/phpunit/ExtensionTest.php
@@ -44,7 +44,7 @@
}
protected function newInstanceFromGlobalSettings() {
- return new Extension( Settings::newFromGlobals( $GLOBALS ) );
+ return new Extension( new Settings( $GLOBALS['egEPSettings'] )
);
}
}
--
To view, visit https://gerrit.wikimedia.org/r/69977
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I29340093b7141b10498d2d1eaffb8125d6c9a224
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits