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 IterableType) {
return new self($this->getItemType()->combineWith($otherType->getItemType()), $this->isNullable() || $otherType->isNullable());
}
if ($otherType instanceof NullType) {
return $this->makeNullable();
}
return new MixedType($this->isNullable() || $otherType->isNullable());
}