public function getPart($part) { if ($part && in_array($part, $this->validMsgParts)) { return $this->{$part}; } throw new UnexpectedValueException("`{$part}` not a valid message part."); }