You are here

public static function DevelGenerateBase::isNumber in Devel 4.x

Same name and namespace in other branches
  1. 8.3 devel_generate/src/DevelGenerateBase.php \Drupal\devel_generate\DevelGenerateBase::isNumber()
  2. 8 devel_generate/src/DevelGenerateBase.php \Drupal\devel_generate\DevelGenerateBase::isNumber()
  3. 8.2 devel_generate/src/DevelGenerateBase.php \Drupal\devel_generate\DevelGenerateBase::isNumber()

Check if a given param is a number.

Parameters

mixed $number: The parameter to check.

Return value

bool TRUE if the parameter is a number, FALSE otherwise.

3 calls to DevelGenerateBase::isNumber()
MenuDevelGenerate::validateDrushParams in devel_generate/src/Plugin/DevelGenerate/MenuDevelGenerate.php
Responsible for validating Drush params.
TermDevelGenerate::validateDrushParams in devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php
Responsible for validating Drush params.
VocabularyDevelGenerate::validateDrushParams in devel_generate/src/Plugin/DevelGenerate/VocabularyDevelGenerate.php
Responsible for validating Drush params.

File

devel_generate/src/DevelGenerateBase.php, line 169

Class

DevelGenerateBase
Provides a base DevelGenerate plugin implementation.

Namespace

Drupal\devel_generate

Code

public static function isNumber($number) {
  if ($number == NULL) {
    return FALSE;
  }
  if (!is_numeric($number)) {
    return FALSE;
  }
  return TRUE;
}