<?php declare(strict_types = 1);

namespace Drupal\{{ machine_name }}\Cache\Context;

use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Cache\Context\{{ interface }};
{% if base_class %}
use Drupal\Core\Cache\Context\{{ base_class }};
{% endif %}

/**
 * @todo Add a description for the cache context.
 *
 * Cache context ID: '{{ context_id }}'.
 *
 * @DCG
 * Check out the core/lib/Drupal/Core/Cache/Context directory for examples of
 * cache contexts provided by Drupal core.
 */
final class {{ class }} {% if base_class %}extends {{ base_class }} {% endif %}implements {{ interface }} {

  /**
   * {@inheritdoc}
   */
  public static function getLabel(): string {
    return (string) t('{{ context_label }}');
  }

  /**
   * {@inheritdoc}
   */
  public function getContext({% if calculated %}$parameter = NULL{% endif %}): string {
    // @todo Calculate the cache context here.
    $context = 'some_string_value';
    return $context;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata({% if calculated %}$parameter = NULL{% endif %}): CacheableMetadata {
    return new CacheableMetadata();
  }

}
