sFullNameRaw = $sFullNameRaw; $this->sDelimiter = $sDelimiter; $this->aFlags = $aFlags; $this->aFlagsLowerCase = \array_map('strtolower', $this->aFlags); $this->sFullNameRaw = 'INBOX'.$this->sDelimiter === \substr(\strtoupper($this->sFullNameRaw), 0, 5 + \strlen($this->sDelimiter)) ? 'INBOX'.\substr($this->sFullNameRaw, 5) : $this->sFullNameRaw; if ($this->IsInbox()) { $this->sFullNameRaw = 'INBOX'; } $this->sNameRaw = $this->sFullNameRaw; if (0 < \strlen($this->sDelimiter)) { $aNames = \explode($this->sDelimiter, $this->sFullNameRaw); if (false !== \array_search('', $aNames)) { throw new \MailSo\Base\Exceptions\InvalidArgumentException; } $this->sNameRaw = \end($aNames); } } public function NameRaw() : string { return $this->sNameRaw; } public function FullNameRaw() : string { return $this->sFullNameRaw; } public function Delimiter() : string { return $this->sDelimiter; } public function Flags() : array { return $this->aFlags; } public function FlagsLowerCase() : array { return $this->aFlagsLowerCase; } public function IsSelectable() : bool { return !\in_array('\noselect', $this->aFlagsLowerCase); } public function IsInbox() : bool { return 'INBOX' === \strtoupper($this->sFullNameRaw) || \in_array('\inbox', $this->aFlagsLowerCase); } /** * @param mixed $mData */ public function SetExtended(string $sName, $mData) : void { $this->aExtended[$sName] = $mData; } /** * @return mixed */ public function GetExtended(string $sName) { return isset($this->aExtended[$sName]) ? $this->aExtended[$sName] : null; } }