src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php
public static function getTypeFromValue($value)
    {
        switch (gettype($value)) {
            case 'boolean':
                if ($value) {
                    return Type::getTrue();
                }

                return Type::getFalse();

            case 'integer':
                return Type::getInt(false, $value);

            case 'double':
                return Type::getFloat($value);

            case 'string':
                return Type::getString($value);

            case 'array':
                return Type::getArray();

            case 'NULL':
                return Type::getNull();

            default:
                return Type::getMixed();
        }
    }
public static function getTypeFromValue($value)
    {
        switch (gettype($value)) {
            case 'boolean':
                if ($value) {
                    return Type::getTrue();
                }

                return Type::getFalse();

            case 'integer':
                return Type::getInt(false, $value);

            case 'double':
                return Type::getFloat($value);

            case 'string':
                return Type::getString($value);

            case 'array':
                return Type::getArray();

            case 'NULL':
                return Type::getNull();

            default:
                return Type::getMixed();
        }
    }
public static function getTypeFromValue ( $ value ) { switch ( gettype ( $ value ) ) { case 'boolean' : if ( $ value ) { return Type :: getTrue ( ) ; } return Type :: getFalse ( ) ; case 'integer' : return Type :: getInt ( false , $ value ) ; case 'double' : return Type :: getFloat ( $ value ) ; case 'string' : return Type :: getString ( $ value ) ; case 'array' : return Type :: getArray ( ) ; case 'NULL' : return Type :: getNull ( ) ; default : return Type :: getMixed ( ) ; } }
Gets the Psalm type from a particular value

@param  mixed $value

@return Type\Union
Gets the Psalm type from a particular value