interface InputCollectorInterface

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Recipe/InputCollectorInterface.php \Drupal\Core\Recipe\InputCollectorInterface

Collects user-provided input values for recipes.

Implementations of this interface are responsible for obtaining values required by recipes at runtime. This allows recipes to request dynamic information (for example, a site name or administrator email address) from the user or another source, rather than hardcoding values.

Hierarchy

Expanded class hierarchy of InputCollectorInterface

All classes that implement InputCollectorInterface

See also

\Drupal\Core\Recipe\FormInputCollector

\Drupal\Core\Recipe\PredefinedInputCollector

1 file declares its use of InputCollectorInterface
InputTest.php in core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php

File

core/lib/Drupal/Core/Recipe/InputCollectorInterface.php, line 20

Namespace

Drupal\Core\Recipe
View source
interface InputCollectorInterface {
  
  /**
   * Collects a single input value for a recipe.
   *
   * @param string $name
   *   The machine name of the input to collect, in the form
   *   RECIPE_NAME.INPUT_NAME.
   * @param \Drupal\Core\TypedData\DataDefinitionInterface $definition
   *   The data definition that describes the expected type, constraints, and
   *   metadata for the input value.
   * @param mixed $default_value
   *   The default value to return if no input is provided.
   *
   * @return mixed
   *   The collected input value that satisfies the provided definition.
   */
  public function collectValue(string $name, DataDefinitionInterface $definition, mixed $default_value) : mixed;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
InputCollectorInterface::collectValue public function Collects a single input value for a recipe. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.