Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 4 |
| RouteNameCacheContext | |
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\RouteNameCacheContext. | |
| */ | |
| namespace Drupal\Core\Cache\Context; | |
| /** | |
| * Defines the RouteCacheContext service, for "per route name" caching. | |
| * | |
| * Cache context ID: 'route.name'. | |
| */ | |
| class RouteNameCacheContext extends RouteCacheContext { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public static function getLabel() { | |
| return t('Route name'); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getContext() { | |
| return $this->routeMatch->getRouteName(); | |
| } | |
| } |