You are here

public static function FormHelper::isValidPriority in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::isValidPriority()
  2. 8.2 src/Form/FormHelper.php \Drupal\simple_sitemap\Form\FormHelper::isValidPriority()

Parameters

string|int $priority:

Return value

bool

1 call to FormHelper::isValidPriority()
CustomLinksForm::validateForm in src/Form/CustomLinksForm.php
Form validation handler.

File

src/Form/FormHelper.php, line 561

Class

FormHelper
Class FormHelper

Namespace

Drupal\simple_sitemap\Form

Code

public static function isValidPriority(string $priority) : bool {
  return is_numeric($priority) && $priority >= 0 && $priority <= 1;
}