src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php
protected function askNumeric( $question, $default = null ) {
		$ask = 'Your answer needs to be a numeric value';

		if ( ! is_null( $default ) ) {
			$question .= ' [Default: '. $default .'] ';
			$ask .= ' or blank for default';
		}

		$answer = $this->ask( $question );

		while ( ! is_numeric( $answer ) and ! ( $answer == '' and ! is_null( $default ) ) ) {
			$answer = $this->ask( $ask .'. ');
		}
		if ( $answer == '' ) {
			$answer = $default;
		}
		return $answer;
	}
protected function askNumeric( $question, $default = null ) {
		$ask = 'Your answer needs to be a numeric value';

		if ( ! is_null( $default ) ) {
			$question .= ' [Default: '. $default .'] ';
			$ask .= ' or blank for default';
		}

		$answer = $this->ask( $question );

		while ( ! is_numeric( $answer ) and ! ( $answer == '' and ! is_null( $default ) ) ) {
			$answer = $this->ask( $ask .'. ');
		}
		if ( $answer == '' ) {
			$answer = $default;
		}
		return $answer;
	}
protected function askNumeric ( $ question , $ default = null ) { $ ask = 'Your answer needs to be a numeric value' ; if ( ! is_null ( $ default ) ) { $ question .= ' [Default: ' . $ default . '] ' ; $ ask .= ' or blank for default' ; } $ answer = $ this -> ask ( $ question ) ; while ( ! is_numeric ( $ answer ) and ! ( $ answer == '' and ! is_null ( $ default ) ) ) { $ answer = $ this -> ask ( $ ask . '. ' ) ; } if ( $ answer == '' ) { $ answer = $ default ; } return $ answer ; }
Ask user for a Numeric Value, or blank for default
@param  string    $question Question to ask
@param  int|float $default  Default Value (optional)
@return int|float           Answer
Ask user for a Numeric Value or blank for default