public static Cache::mergeContexts(array $a = [], array $b = [])
Merges arrays of cache contexts and removes duplicates.
Parameters
array $a: Cache contexts array to merge.
array $b: Cache contexts array to merge.
Return value
string[] The merged array of cache contexts.
File
- core/lib/Drupal/Core/Cache/Cache.php, line 30
Class
- Cache
- Helper methods for cache.
Namespace
Drupal\Core\Cache
Code
public static function mergeContexts(array $a = [], array $b = []) { $cache_contexts = array_unique(array_merge($a, $b)); assert('\Drupal::service(\'cache_contexts_manager\')->assertValidTokens($cache_contexts)'); sort($cache_contexts); return $cache_contexts; }
Please login to continue.