src/DBALTypesResolver.php
public static function tryGetTypeForValue($value)
    {
        if (!is_object($value)) {
            return null;
        }

        // maybe it's a ValueObject

        // try get type name from types map
        $className = get_class($value);
        if (isset(self::$typesMap[$className])) {
            return Type::getType(self::$typesMap[$className]);
        }

        // use class name as type name
        $classNameParts = explode('\\', $className);
        $typeName = array_pop($classNameParts);

        if (array_key_exists($typeName, Type::getTypesMap())) {
            return Type::getType($typeName);
        }

        return null;
    }
public static function tryGetTypeForValue($value)
    {
        if (!is_object($value)) {
            return null;
        }

        // maybe it's a ValueObject

        // try get type name from types map
        $className = get_class($value);
        if (isset(self::$typesMap[$className])) {
            return Type::getType(self::$typesMap[$className]);
        }

        // use class name as type name
        $classNameParts = explode('\\', $className);
        $typeName = array_pop($classNameParts);

        if (array_key_exists($typeName, Type::getTypesMap())) {
            return Type::getType($typeName);
        }

        return null;
    }
public static function tryGetTypeForValue ( $ value ) { if ( ! is_object ( $ value ) ) { return null ; } // maybe it's a ValueObject // try get type name from types map $ className = get_class ( $ value ) ; if ( isset ( self :: $ typesMap [ $ className ] ) ) { return Type :: getType ( self :: $ typesMap [ $ className ] ) ; } // use class name as type name $ classNameParts = explode ( '\\' , $ className ) ; $ typeName = array_pop ( $ classNameParts ) ; if ( array_key_exists ( $ typeName , Type :: getTypesMap ( ) ) ) { return Type :: getType ( $ typeName ) ; } return null ; }
Try get type for value.

If type is not found return NULL.

@param mixed $value

@return Type|null
Try get type for value .