You are here

public function UriCondition::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/UriCondition.php, line 32

Class

UriCondition
Filter condition using request URI.

Namespace

Drupal\access_filter\Plugin\AccessFilter\Condition

Code

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