PHPStan\Type\CallableType::combineWith PHP Method

combineWith() public method

public combineWith ( PHPStan\Type\Type $otherType ) : PHPStan\Type\Type
$otherType PHPStan\Type\Type
return PHPStan\Type\Type
    public function combineWith(Type $otherType) : Type
    {
        if ($otherType instanceof self) {
            return new self($this->isNullable() || $otherType->isNullable());
        }
        if ($otherType instanceof ArrayType && $otherType->isPossiblyCallable()) {
            return $this;
        }
        if ($otherType instanceof NullType) {
            return $this->makeNullable();
        }
        return new MixedType($this->isNullable() || $otherType->isNullable());
    }