private function normalizeNumber($number)
    {
        if (!is_numeric($number)) {
            throw new InvalidArgumentException('Number expected');
        }

        $number = floatval($number);

        if ($number < 0) {
            throw new InvalidArgumentException('The number expected was >= 0');
        }

        return max($number, 1);
    }
private function normalizeNumber($number)
    {
        if (!is_numeric($number)) {
            throw new InvalidArgumentException('Number expected');
        }

        $number = floatval($number);

        if ($number < 0) {
            throw new InvalidArgumentException('The number expected was >= 0');
        }

        return max($number, 1);
    }
private function normalizeNumber ( $ number ) { if ( ! is_numeric ( $ number ) ) { throw new InvalidArgumentException ( 'Number expected' ) ; } $ number = floatval ( $ number ) ; if ( $ number < 0 ) { throw new InvalidArgumentException ( 'The number expected was >= 0' ) ; } return max ( $ number , 1 ) ; }
This function transform a number to a float value or raise an Exception.

@param mixed $number number to be normalized

@return int
@throws InvalidArgumentException
This function transform a number to a float value or raise an Exception .