PHPStan\Analyser\Scope::enterClosureBind PHP Method

enterClosureBind() public method

public enterClosureBind ( PHPStan\Type\Type $thisType = null, string $scopeClass ) : self
$thisType PHPStan\Type\Type
$scopeClass string
return self
    public function enterClosureBind(Type $thisType = null, string $scopeClass) : self
    {
        $variableTypes = $this->getVariableTypes();
        if ($thisType !== null) {
            $variableTypes['this'] = $thisType;
        } else {
            unset($variableTypes['this']);
        }
        if ($scopeClass === 'static') {
            $scopeClass = $this->getClass();
        }
        return new self($this->broker, $this->printer, $this->getFile(), $this->isDeclareStrictTypes(), $this->getClass(), $this->getFunction(), $this->getNamespace(), $variableTypes, $scopeClass, $this->getAnonymousFunctionReturnType(), $this->isInAnonymousClass() ? $this->getAnonymousClass() : null, $this->getInFunctionCall(), $this->isNegated(), $this->moreSpecificTypes);
    }