function DevelGenerateBase::isNumber

Same name in other branches
  1. 5.x 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;
}