Skip to content
Snippets Groups Projects

changed input/inputs to explicit_inputs.

Files
19
@@ -69,8 +69,8 @@ interface ComponentSourceInterface extends PluginInspectionInterface, Derivative
/**
* Renders a component for the given instance.
*
* @param array $inputs
* Component inputs — both implicit and explicit.
* @param array $explicit_inputs
* Component instance explicit inputs.
* @param string $componentUuid
* Component UUID.
* @param bool $isPreview
@@ -79,29 +79,29 @@ interface ComponentSourceInterface extends PluginInspectionInterface, Derivative
* @return array
* Render array.
*/
public function renderComponent(array $inputs, string $componentUuid, bool $isPreview): array;
public function renderComponent(array $explicit_inputs, string $componentUuid, bool $isPreview): array;
/**
* Whether this component requires explicit input or not.
* Whether this component requires explicit inputs or not.
*/
public function requiresExplicitInput(): bool;
public function requiresExplicitInputs(): bool;
/**
* Returns the default explicit input (prop sources) for this component.
* Returns the default explicit inputs (prop sources) for this component.
*
* @phpcs:ignore
* @return SingleComponentInputArray
* An array of prop sources to use for the inputs of this component, keyed
* by input name.
* An array of prop sources to use for the explicit inputs of this component,
* keyed by prop name.
*/
public function getDefaultExplicitInput(): array;
public function getDefaultExplicitInputs(): array;
/**
* Retrieves the component instance's explicit (possibly empty) input.
* Retrieves the component instance's explicit (possibly empty) inputs.
*
* @todo Add ::getImplicitInput() in https://www.drupal.org/project/experience_builder/issues/3485502 — SDCs don't have implicit inputs, but Block plugins do: contexts
* @todo Add ::getImplicitInputs() in https://www.drupal.org/project/experience_builder/issues/3485502 — SDCs don't have implicit inputs, but Block plugins do: contexts
*/
public function getExplicitInput(string $uuid, ComponentTreeItem $item): array;
public function getExplicitInputs(string $uuid, ComponentTreeItem $item): array;
/**
* Hydrates a component with its explicit input plus slots (if any).
@@ -114,22 +114,22 @@ interface ComponentSourceInterface extends PluginInspectionInterface, Derivative
*
* @see \Drupal\experience_builder\ComponentSource\ComponentSourceWithSlotsInterface::setSlots()
*/
public function hydrateComponent(array $explicit_input): array;
public function hydrateComponent(array $explicit_inputs): array;
/**
* Normalizes explicit inputs to the data model expected by the client.
*
* Note that the result MUST NOT contain slot information.
*
* @param array $explicit_input
* @param array $explicit_inputs
*
* @return array
*
* @see openapi.yml
* @see ::clientModelToInput()
* @see ::clientModelToExplicitInputs()
* @see \Drupal\experience_builder\Entity\XbHttpApiEligibleConfigEntityInterface::normalizeForClientSide
*/
public function inputToClientModel(array $explicit_input): array;
public function explicitInputsToClientModel(array $explicit_inputs): array;
/**
* Gets the plugin definition.
@@ -164,7 +164,7 @@ interface ComponentSourceInterface extends PluginInspectionInterface, Derivative
* @param array $client_model
* Current client model values for the component from the incoming request.
* @param \Drupal\Core\Entity\EntityInterface|null $entity
* The host entity (for evaluated input).
* The host entity (for evaluated explicit inputs).
* @param array $settings
* The component configuration entity settings.
*
@@ -195,15 +195,15 @@ interface ComponentSourceInterface extends PluginInspectionInterface, Derivative
* @phpcs:ignore
* @return SingleComponentInputArray
* @todo Refactor to use the Symfony denormalizer infrastructure?
* @see ::inputToClientModel()
* @see ::explicitInputsToClientModel()
*/
public function clientModelToInput(string $component_instance_uuid, Component $component, array $client_model, ?ConstraintViolationListInterface $violations = NULL): array;
public function clientModelToExplicitInputs(string $component_instance_uuid, Component $component, array $client_model, ?ConstraintViolationListInterface $violations = NULL): array;
/**
* Validates component input.
*
* @param array $inputValues
* Input values stored for this component.
* @param array $explicit_inputs
* Explicit inputs stored for this component.
* @param string $component_instance_uuid
* Component instance UUID.
* @param \Drupal\Core\Entity\FieldableEntityInterface|null $entity
@@ -212,7 +212,7 @@ interface ComponentSourceInterface extends PluginInspectionInterface, Derivative
* @return \Symfony\Component\Validator\ConstraintViolationListInterface
* Any violations.
*/
public function validateComponentInput(array $inputValues, string $component_instance_uuid, ?FieldableEntityInterface $entity): ConstraintViolationListInterface;
public function validateComponentExplicitInputs(array $explicit_inputs, string $component_instance_uuid, ?FieldableEntityInterface $entity): ConstraintViolationListInterface;
/**
* Checks if component meets requirements.
Loading