X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Ftemplates%2Fmodule%2Fsrc%2Fcache-context.php.twig;h=5445fb3bf7be4c139693048d414a6111c13f2ca7;hp=09c3e4b9f3bc9a7d2f64bd96ac03c5f42dc840cf;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/drupal/console/templates/module/src/cache-context.php.twig b/vendor/drupal/console/templates/module/src/cache-context.php.twig index 09c3e4b9f..5445fb3bf 100644 --- a/vendor/drupal/console/templates/module/src/cache-context.php.twig +++ b/vendor/drupal/console/templates/module/src/cache-context.php.twig @@ -9,6 +9,7 @@ namespace Drupal\{{module}}\CacheContext; {% endblock %} {% block use_class %} +use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\Context\CacheContextInterface; {% endblock %} @@ -23,8 +24,8 @@ class {{ class }} implements CacheContextInterface {% endblock %} {% block class_construct %} /** - * Constructor. - */ + * Constructs a new {{ class }} object. + */ public function __construct({{ servicesAsParameters(services)|join(', ') }}) { {{ serviceClassInitialization(services) }} } @@ -35,21 +36,21 @@ class {{ class }} implements CacheContextInterface {% endblock %} /** * {@inheritdoc} */ - static function getLabel() { - drupal_set_message('Lable of cache context'); + public static function getLabel() { + drupal_set_message('Lable of cache context'); } /** * {@inheritdoc} */ public function getContext() { - // Actual logic of context variation will lie here. + // Actual logic of context variation will lie here. } /** * {@inheritdoc} */ public function getCacheableMetadata() { - // The buble cache metadata. + return new CacheableMetadata(); } {% endblock %}