key() публичный статический Метод

Generates the cache key.
public static key ( mixed $key, array $data = [] ) : string
$key mixed A string (or lambda/closure that evaluates to a string) that will be used as the cache key.
$data array If a lambda/closure is used as a key and requires arguments, pass them in here.
Результат string The generated cache key.
Пример #1
0
 public function testKeyWithClosureAndArguments()
 {
     $value = 'closure argument';
     $key = function ($value) {
         return $value;
     };
     $result = Cache::key($key($value));
     $expected = 'closure argument';
     $this->assertIdentical($expected, $result);
 }