addInternal($segment); } } else { $this->addInternal($segments); } return $this; } private function addInternal(BaseSegment $segment) { if ($segment->segmentkopf === null) { throw new \InvalidArgumentException( 'Segment lacks Segmentkopf, maybe you called ctor instead of createEmpty()'); } $this->segments[] = $segment; } // Note: There is no single build() function, use Message::createWrappedMessage() instead. }