Update doc block for withCommon to indicate an array of strings, shorten serialized cache key

This commit is contained in:
Robbie Averill 2018-02-28 09:30:17 +13:00
parent 31991858ef
commit c64c0c05c7

View File

@ -170,13 +170,13 @@ abstract class SearchVariant
* Similar to {@link SearchVariant::with}, except will only use variants that apply to at least one of the classes
* in the input array, where {@link SearchVariant::with} will run the query on the specific class you give it.
*
* @param array $classes
* @param string[] $classes
* @return SearchVariant_Caller
*/
public static function withCommon(array $classes = [])
{
// Allow caching
$cacheKey = serialize($classes);
$cacheKey = sha1(serialize($classes));
if (isset(self::$call_instances[$cacheKey])) {
return self::$call_instances[$cacheKey];
}