Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 4 |
SessionCacheContext | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 4 |
getLabel | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
getContext | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\Core\Cache\Context\SessionCacheContext. | |
*/ | |
namespace Drupal\Core\Cache\Context; | |
/** | |
* Defines the SessionCacheContext service, for "per session" caching. | |
* | |
* Cache context ID: 'session'. | |
*/ | |
class SessionCacheContext extends RequestStackCacheContextBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public static function getLabel() { | |
return t('Session'); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getContext() { | |
return $this->requestStack->getCurrentRequest()->getSession()->getId(); | |
} | |
} |