public function getNumber($min, $max)
    {
        $min = (int) $min;
        $max = (int) $max;

        if ($min > $max) {
            throw new \InvalidArgumentException('Invalid minimum and maximum value');
        }

        if ($min === $max) {
            return $min;
        }

        $difference = $max - $min;

        if (!is_int($difference)) {
            throw new GeneratorException('Too large difference between minimum and maximum');
        }

        return $min + $this->getByteNumber($difference);
    }
public function getNumber($min, $max)
    {
        $min = (int) $min;
        $max = (int) $max;

        if ($min > $max) {
            throw new \InvalidArgumentException('Invalid minimum and maximum value');
        }

        if ($min === $max) {
            return $min;
        }

        $difference = $max - $min;

        if (!is_int($difference)) {
            throw new GeneratorException('Too large difference between minimum and maximum');
        }

        return $min + $this->getByteNumber($difference);
    }
public function getNumber ( $ min , $ max ) { $ min = ( int ) $ min ; $ max = ( int ) $ max ; if ( $ min > $ max ) { throw new \ InvalidArgumentException ( 'Invalid minimum and maximum value' ) ; } if ( $ min === $ max ) { return $ min ; } $ difference = $ max - $ min ; if ( ! is_int ( $ difference ) ) { throw new GeneratorException ( 'Too large difference between minimum and maximum' ) ; } return $ min + $ this -> getByteNumber ( $ difference ) ; }
Returns a random integer between given minimum and maximum.
@param int $min The minimum possible value to return
@param int $max The maximum possible value to return
@return int A random number between the lower and upper limit (inclusive)
@throws \InvalidArgumentException If the provided values are invalid
@throws GeneratorException If an error occurs generating the number
Returns a random integer between given minimum and maximum .