From 93120703f68d72ce6863bb0fc38e6f9eedea84ac Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 18 Nov 2017 12:39:21 -0800 Subject: [PATCH] objectcache: fix some makeKey/makeGlobalKey IDEA warnings Change-Id: I5fefda9676a685167326c63c34b2b7df8be2e7cd --- includes/libs/objectcache/BagOStuff.php | 10 ++++++---- includes/libs/objectcache/CachedBagOStuff.php | 4 ++-- includes/libs/objectcache/MultiWriteBagOStuff.php | 4 ++-- includes/libs/objectcache/WANObjectCache.php | 10 ++++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index d6cb340551..8420f113ff 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -747,10 +747,11 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface { * Make a global cache key. * * @since 1.27 - * @param string $keys,... Key component (starting with a key collection name) + * @param string $class Key class + * @param string $component [optional] Key component (starting with a key collection name) * @return string Colon-delimited list of $keyspace followed by escaped components of $args */ - public function makeGlobalKey() { + public function makeGlobalKey( $class, $component = null ) { return $this->makeKeyInternal( 'global', func_get_args() ); } @@ -758,10 +759,11 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface { * Make a cache key, scoped to this instance's keyspace. * * @since 1.27 - * @param string $keys,... Key component (starting with a key collection name) + * @param string $class Key class + * @param string $component [optional] Key component (starting with a key collection name) * @return string Colon-delimited list of $keyspace followed by escaped components of $args */ - public function makeKey() { + public function makeKey( $class, $component = null ) { return $this->makeKeyInternal( $this->keyspace, func_get_args() ); } diff --git a/includes/libs/objectcache/CachedBagOStuff.php b/includes/libs/objectcache/CachedBagOStuff.php index c85a82ea01..ae434c1738 100644 --- a/includes/libs/objectcache/CachedBagOStuff.php +++ b/includes/libs/objectcache/CachedBagOStuff.php @@ -86,11 +86,11 @@ class CachedBagOStuff extends HashBagOStuff { return $this->backend->deleteObjectsExpiringBefore( $date, $progressCallback ); } - public function makeKey() { + public function makeKey( $class, $component = null ) { return call_user_func_array( [ $this->backend, __FUNCTION__ ], func_get_args() ); } - public function makeGlobalKey() { + public function makeGlobalKey( $class, $component = null ) { return call_user_func_array( [ $this->backend, __FUNCTION__ ], func_get_args() ); } diff --git a/includes/libs/objectcache/MultiWriteBagOStuff.php b/includes/libs/objectcache/MultiWriteBagOStuff.php index 200ab7969c..643f318315 100644 --- a/includes/libs/objectcache/MultiWriteBagOStuff.php +++ b/includes/libs/objectcache/MultiWriteBagOStuff.php @@ -233,11 +233,11 @@ class MultiWriteBagOStuff extends BagOStuff { return $ret; } - public function makeKey() { + public function makeKey( $class, $component = null ) { return call_user_func_array( [ $this->caches[0], __FUNCTION__ ], func_get_args() ); } - public function makeGlobalKey() { + public function makeGlobalKey( $class, $component = null ) { return call_user_func_array( [ $this->caches[0], __FUNCTION__ ], func_get_args() ); } } diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index 73e4a9a263..3c91dedae1 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -1388,21 +1388,23 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { /** * @see BagOStuff::makeKey() - * @param string $keys,... Key component (starting with a key collection name) + * @param string $class Key class + * @param string $component [optional] Key component (starting with a key collection name) * @return string Colon-delimited list of $keyspace followed by escaped components of $args * @since 1.27 */ - public function makeKey() { + public function makeKey( $class, $component = null ) { return call_user_func_array( [ $this->cache, __FUNCTION__ ], func_get_args() ); } /** * @see BagOStuff::makeGlobalKey() - * @param string $keys,... Key component (starting with a key collection name) + * @param string $class Key class + * @param string $component [optional] Key component (starting with a key collection name) * @return string Colon-delimited list of $keyspace followed by escaped components of $args * @since 1.27 */ - public function makeGlobalKey() { + public function makeGlobalKey( $class, $component = null ) { return call_user_func_array( [ $this->cache, __FUNCTION__ ], func_get_args() ); } -- 2.20.1