You are here

public function HttpConfigRequestForm::integerValue in HTTP Client Manager 8.2

Same name and namespace in other branches
  1. 8 src/Form/HttpConfigRequestForm.php \Drupal\http_client_manager\Form\HttpConfigRequestForm::integerValue()

Value callback: casts provided input to integer.

Parameters

array $element: The form element.

string $input: The input value.

\Drupal\Core\Form\FormStateInterface $form_state: The Form State instance.

Return value

int|null The integer value or NULL if no value has been provided.

File

src/Form/HttpConfigRequestForm.php, line 207

Class

HttpConfigRequestForm
Class HttpConfigRequestForm.

Namespace

Drupal\http_client_manager\Form

Code

public function integerValue(&$element, $input, FormStateInterface $form_state) {
  if ($input !== FALSE && $input !== NULL) {
    return (int) $input;
  }
  return NULL;
}