Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/312545
Change subject: Remove unused $flags parameter for EchoSeenTime::getTime()
......................................................................
Remove unused $flags parameter for EchoSeenTime::getTime()
It was always set to 0, and we were using the old (pre-2015)
get() interface so it wouldn't have worked anyway.
Change-Id: Ie92b223a485a5d9d256d2dc69d4ff3807e838878
Bonus: remove documentation for nonexistent parameter for setTime().
---
M Hooks.php
M includes/SeenTime.php
M includes/api/ApiEchoNotifications.php
3 files changed, 7 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/45/312545/1
diff --git a/Hooks.php b/Hooks.php
index 5c37247..e9472ad 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -862,8 +862,8 @@
// If this is the Special:Notifications page, seenTime
to now
$seenTime->setTime( wfTimestamp( TS_MW ),
EchoAttributeManager::ALL );
}
- $seenAlertTime = $seenTime->getTime( 'alert', /*flags*/ 0,
TS_ISO_8601 );
- $seenMsgTime = $seenTime->getTime( 'message', /*flags*/ 0,
TS_ISO_8601 );
+ $seenAlertTime = $seenTime->getTime( 'alert', TS_ISO_8601 );
+ $seenMsgTime = $seenTime->getTime( 'message', TS_ISO_8601 );
$sk->getOutput()->addJsConfigVars( 'wgEchoSeenTime', array(
'alert' => $seenAlertTime,
diff --git a/includes/SeenTime.php b/includes/SeenTime.php
index 687613c..3fc4e54 100644
--- a/includes/SeenTime.php
+++ b/includes/SeenTime.php
@@ -55,17 +55,16 @@
/**
* @param string $type Type of seen time to get
- * @param int $flags BagOStuff::READ_LATEST to use the master
* @param int $format Format to return time in, defaults to TS_MW
* @return string|bool Timestamp in specified format, or false if no
stored time
*/
- public function getTime( $type = 'all', $flags = 0, $format = TS_MW ) {
+ public function getTime( $type = 'all', $format = TS_MW ) {
$vals = array();
if ( $type === 'all' ) {
foreach ( self::$allowedTypes as $allowed ) {
// Use TS_MW, then convert later, so max works
properly for
// all formats.
- $vals[] = $this->getTime( $allowed, $flags,
TS_MW );
+ $vals[] = $this->getTime( $allowed, TS_MW );
}
return wfTimestamp( $format, min( $vals ) );
@@ -75,8 +74,7 @@
return false;
}
- $cas = 0; // Unused, but we have to pass something by reference
- $data = self::cache()->get( $this->getMemcKey( $type ), $cas,
$flags );
+ $data = self::cache()->get( $this->getMemcKey( $type ) );
if ( $data === false ) {
// Check if the user still has it set in their
preferences
@@ -98,7 +96,6 @@
*
* @param string $time Time, in TS_MW format
* @param string $type Type of seen time to set
- * @param string $sourceWiki Source wiki to set it for, defaults to
current
*/
public function setTime( $time, $type = 'all' ) {
if ( $type === 'all' ) {
diff --git a/includes/api/ApiEchoNotifications.php
b/includes/api/ApiEchoNotifications.php
index 2f67f2e..9592e87 100644
--- a/includes/api/ApiEchoNotifications.php
+++ b/includes/api/ApiEchoNotifications.php
@@ -331,12 +331,12 @@
if ( $groupBySection ) {
foreach ( $sections as $section ) {
- $result[$section]['seenTime'] =
$seenTimeHelper->getTime( $section, /*flags*/ 0, TS_ISO_8601 );
+ $result[$section]['seenTime'] =
$seenTimeHelper->getTime( $section, TS_ISO_8601 );
}
} else {
$result['seenTime'] = array();
foreach ( $sections as $section ) {
- $result['seenTime'][$section] =
$seenTimeHelper->getTime( $section, /*flags*/ 0, TS_ISO_8601 );
+ $result['seenTime'][$section] =
$seenTimeHelper->getTime( $section, TS_ISO_8601 );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/312545
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie92b223a485a5d9d256d2dc69d4ff3807e838878
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits