You are here

public function IpRule::validateConfiguration in Access Filter 8

Validates configuration data.

Parameters

array $configuration: The array containing configurations.

Return value

array An array of error messages.

Overrides RuleInterface::validateConfiguration

File

src/Plugin/AccessFilter/Rule/IpRule.php, line 58

Class

IpRule
Filter rule using IP address.

Namespace

Drupal\access_filter\Plugin\AccessFilter\Rule

Code

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