public function addType(Type $type)
    {
        if ($type instanceof self) {
            foreach ($type->getTypes() as $subType) {
                $this->types[] = $subType;
            }

            return $this;
        }

        $this->types[] = $type;

        return $this;
    }
public function addType(Type $type)
    {
        if ($type instanceof self) {
            foreach ($type->getTypes() as $subType) {
                $this->types[] = $subType;
            }

            return $this;
        }

        $this->types[] = $type;

        return $this;
    }
public function addType ( Type $ type ) { if ( $ type instanceof self ) { foreach ( $ type -> getTypes ( ) as $ subType ) { $ this -> types [ ] = $ subType ; } return $ this ; } $ this -> types [ ] = $ type ; return $ this ; }
Add a type.

@param Type $type

@return $this
Add a type .