You are here

public function HttpConfigRequestForm::floatValue in HTTP Client Manager 8.2

Value callback: casts provided input to float.

Parameters

array $element: The form element.

string $input: The input value.

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

Return value

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

File

src/Form/HttpConfigRequestForm.php, line 227

Class

HttpConfigRequestForm
Class HttpConfigRequestForm.

Namespace

Drupal\http_client_manager\Form

Code

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