PHPStan\Analyser\Scope::unsetVariable PHP Method

unsetVariable() public method

public unsetVariable ( string $variableName ) : self
$variableName string
return self
    public function unsetVariable(string $variableName) : self
    {
        if (!$this->hasVariableType($variableName)) {
            return $this;
        }
        $variableTypes = $this->getVariableTypes();
        unset($variableTypes[$variableName]);
        return new self($this->broker, $this->printer, $this->getFile(), $this->isDeclareStrictTypes(), $this->getClass(), $this->getFunction(), $this->getNamespace(), $variableTypes, $this->inClosureBindScopeClass, $this->getAnonymousFunctionReturnType(), $this->isInAnonymousClass() ? $this->getAnonymousClass() : null, $this->getInFunctionCall(), $this->isNegated(), $this->moreSpecificTypes);
    }