wiki.techinc.nl/includes/libs/objectcache/IStoreKeyEncoder.php
Daimona Eaytoy 25ba3b3794 Document more scalar types for BagOStuff::makeKey and Language::formatNum
These were spotted by phan's stricter type checks. All make*Key methods
can also take integers, and that's pretty common across core and
extensions.
Language::formatNum can also take numbers (and tests cover this case);
in this case, move the cast to the top of the method, so that we're
passing a string to strtr, too.

The methods touched in this patch are the main source of false positives
in both core and extensions.

Change-Id: I6d538ce3ca7fd2d495c2bafbab7cc279da69db1c
2019-12-15 00:02:04 +00:00

27 lines
792 B
PHP

<?php
/**
* Generic interface for object stores with key encoding methods.
*
* @ingroup Cache
* @since 1.34
*/
interface IStoreKeyEncoder {
/**
* Make a global cache key.
*
* @param string $class Key class
* @param string|int ...$components Key components (starting with a key collection name)
* @return string Colon-delimited list of $keyspace followed by escaped components
*/
public function makeGlobalKey( $class, ...$components );
/**
* Make a cache key, scoped to this instance's keyspace.
*
* @param string $class Key class
* @param string|int ...$components Key components (starting with a key collection name)
* @return string Colon-delimited list of $keyspace followed by escaped components
*/
public function makeKey( $class, ...$components );
}