You are here

IHaveRuntimeContexts.php in Drupal 10

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/ContextProvider/IHaveRuntimeContexts.php
View source
<?php

namespace Drupal\layout_builder_test\ContextProvider;

use Drupal\Core\Plugin\Context\Context;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Core\Plugin\Context\ContextProviderInterface;

/**
 * Defines a class for a fake context provider.
 */
class IHaveRuntimeContexts implements ContextProviderInterface {

  /**
   * {@inheritdoc}
   */
  public function getRuntimeContexts(array $unqualified_context_ids) {
    return [
      'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?'), 'for sure you can'),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getAvailableContexts() {
    return [
      'runtime_contexts' => new Context(new ContextDefinition('string', 'Do you have runtime contexts?')),
    ];
  }

}

Classes

Namesort descending Description
IHaveRuntimeContexts Defines a class for a fake context provider.