/** * Add a type * * @param Type $type * * @return $this */ public function addType(Type $type) { if ($type instanceof MultipleType) { foreach ($type->getTypes() as $subType) { $this->types[] = $subType; } return $this; } $this->types[] = $type; return $this; }