src/Chippyash/Type/Number/Rational/RationalTypeFactory.php
private static function createFromNumericNumerator($numerator, $denominator)
    {
        if (is_null($denominator)) {
            return self::createCorrectRational($numerator, 1);
        }

        if (is_numeric($denominator)) {
            return self::createCorrectRational($numerator, $denominator);
        }

        if ($denominator instanceof IntType) {
            return self::createCorrectRational($numerator, $denominator());
        }

        self::throwCreateException($numerator, $denominator);
    }
private static function createFromNumericNumerator($numerator, $denominator)
    {
        if (is_null($denominator)) {
            return self::createCorrectRational($numerator, 1);
        }

        if (is_numeric($denominator)) {
            return self::createCorrectRational($numerator, $denominator);
        }

        if ($denominator instanceof IntType) {
            return self::createCorrectRational($numerator, $denominator());
        }

        self::throwCreateException($numerator, $denominator);
    }
private static function createFromNumericNumerator ( $ numerator , $ denominator ) { if ( is_null ( $ denominator ) ) { return self :: createCorrectRational ( $ numerator , 1 ) ; } if ( is_numeric ( $ denominator ) ) { return self :: createCorrectRational ( $ numerator , $ denominator ) ; } if ( $ denominator instanceof IntType ) { return self :: createCorrectRational ( $ numerator , $ denominator ( ) ) ; } self :: throwCreateException ( $ numerator , $ denominator ) ; }
Create where numerator is known to be numeric

@param mixed $numerator Conforms to is_numeric()
@param mixed $denominator

@return GMPRationalType|RationalType

@throws InvalidTypeException
Create where numerator is known to be numeric