You are here

public function ArrayConditionBase::validateConfiguration in Access Filter 8

Validates configuration data.

Parameters

array $configuration: The array containing configurations.

Return value

array An array of error messages.

Overrides ConditionInterface::validateConfiguration

File

src/Plugin/AccessFilter/Condition/ArrayConditionBase.php, line 23

Class

ArrayConditionBase
Base class for condition plugins that checks arrays.

Namespace

Drupal\access_filter\Plugin\AccessFilter\Condition

Code

public function validateConfiguration(array $configuration) {
  $errors = [];
  if (!isset($configuration['key']) || !strlen($configuration['key'])) {
    $errors[] = $this
      ->t("'@property' is required.", [
      '@property' => 'key',
    ]);
  }
  return $errors;
}