src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php
public function addReturnTypes(Context $context)
    {
        if ($this->return_vars_in_scope !== null) {
            $this->return_vars_in_scope = TypeAnalyzer::combineKeyedTypes(
                $context->vars_in_scope,
                $this->return_vars_in_scope
            );
        } else {
            $this->return_vars_in_scope = $context->vars_in_scope;
        }

        if ($this->return_vars_possibly_in_scope !== null) {
            $this->return_vars_possibly_in_scope = array_merge(
                $context->vars_possibly_in_scope,
                $this->return_vars_possibly_in_scope
            );
        } else {
            $this->return_vars_possibly_in_scope = $context->vars_possibly_in_scope;
        }
    }
public function addReturnTypes(Context $context)
    {
        if ($this->return_vars_in_scope !== null) {
            $this->return_vars_in_scope = TypeAnalyzer::combineKeyedTypes(
                $context->vars_in_scope,
                $this->return_vars_in_scope
            );
        } else {
            $this->return_vars_in_scope = $context->vars_in_scope;
        }

        if ($this->return_vars_possibly_in_scope !== null) {
            $this->return_vars_possibly_in_scope = array_merge(
                $context->vars_possibly_in_scope,
                $this->return_vars_possibly_in_scope
            );
        } else {
            $this->return_vars_possibly_in_scope = $context->vars_possibly_in_scope;
        }
    }
public function addReturnTypes ( Context $ context ) { if ( $ this -> return_vars_in_scope !== null ) { $ this -> return_vars_in_scope = TypeAnalyzer :: combineKeyedTypes ( $ context -> vars_in_scope , $ this -> return_vars_in_scope ) ; } else { $ this -> return_vars_in_scope = $ context -> vars_in_scope ; } if ( $ this -> return_vars_possibly_in_scope !== null ) { $ this -> return_vars_possibly_in_scope = array_merge ( $ context -> vars_possibly_in_scope , $ this -> return_vars_possibly_in_scope ) ; } else { $ this -> return_vars_possibly_in_scope = $ context -> vars_possibly_in_scope ; } }
Adds return types for the given function

@param   string  $return_type
@param   Context $context

@return  void
Adds return types for the given function