Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / service / cache-context.services.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.services.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/service/cache-context.services.twig
new file mode 100644 (file)
index 0000000..8e441f0
--- /dev/null
@@ -0,0 +1,10 @@
+services:
+  cache_context.{{ context_id }}:
+    class: Drupal\{{ machine_name }}\Cache\Context\{{ class }}
+{% if base_class == 'RequestStackCacheContextBase' %}
+    arguments: ['@request_stack']
+{% elseif base_class == 'UserCacheContextBase' %}
+    arguments: ['@current_user']
+{% endif %}
+    tags:
+      - { name: cache.context}