public static function fromValue($value) : Type
    {
        switch (gettype($value)) {
            case 'string':
                return Text::long();

            case 'integer':
                return Integer::big();

            case 'double':
                return new Decimal(30, 15);

            case 'boolean':
                return new Boolean();

            case $value instanceof \DateTimeInterface:
                return new DateTime();

            default:
                throw InvalidArgumentException::format(
                        'Invalid call to %s: unknown value type \'%s\' given',
                        __METHOD__, gettype($value)
                );
        }
    }
public static function fromValue($value) : Type
    {
        switch (gettype($value)) {
            case 'string':
                return Text::long();

            case 'integer':
                return Integer::big();

            case 'double':
                return new Decimal(30, 15);

            case 'boolean':
                return new Boolean();

            case $value instanceof \DateTimeInterface:
                return new DateTime();

            default:
                throw InvalidArgumentException::format(
                        'Invalid call to %s: unknown value type \'%s\' given',
                        __METHOD__, gettype($value)
                );
        }
    }
public static function fromValue ( $ value ) : Type { switch ( gettype ( $ value ) ) { case 'string' : return Text :: long ( ) ; case 'integer' : return Integer :: big ( ) ; case 'double' : return new Decimal ( 30 , 15 ) ; case 'boolean' : return new Boolean ( ) ; case $ value instanceof \ DateTimeInterface : return new DateTime ( ) ; default : throw InvalidArgumentException :: format ( 'Invalid call to %s: unknown value type \'%s\' given' , __METHOD__ , gettype ( $ value ) ) ; } }
Gets the equivalent schema type from the supplied PHP value.

@param $value

@return Type
@throws InvalidArgumentException
Gets the equivalent schema type from the supplied PHP value .