From cbff84a5b969a371c2597ce366310a8b69e055c6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 25 May 2017 03:40:26 -0700 Subject: [PATCH] Add missing ampersand to getMultiWithSetCallback() callback Also fixed a php example block comment Change-Id: Ib6967180ad0d45aec7b7d4b6d383723e2c95fefa --- includes/libs/objectcache/WANObjectCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index f0a439a21a..bc6047f93d 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -1073,7 +1073,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { * // Time-to-live (in seconds) * $cache::TTL_DAY, * // Function that derives the new key value - * return function ( $id, $oldValue, &$ttl, array &$setOpts ) { + * function ( $id, $oldValue, &$ttl, array &$setOpts ) { * $dbr = wfGetDB( DB_REPLICA ); * // Account for any snapshot/replica DB lag * $setOpts += Database::getCacheSetOptions( $dbr ); @@ -1118,7 +1118,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { // Wrap $callback to match the getWithSetCallback() format while passing $id to $callback $id = null; - $func = function ( $oldValue, &$ttl, array $setOpts, $oldAsOf ) use ( $callback, &$id ) { + $func = function ( $oldValue, &$ttl, array &$setOpts, $oldAsOf ) use ( $callback, &$id ) { return $callback( $id, $oldValue, $ttl, $setOpts, $oldAsOf ); }; -- 2.20.1