text = null; return; } $this->text = $stripped ? $text : stripslashes($text); } public function getText(): string { return $this->text ?? ''; } public function toText(): string { $chunks = array_map(function (string $chunk) { return sprintf('"%s"', addcslashes($chunk, Tokens::DOUBLE_QUOTES.Tokens::BACKSLASH)); }, str_split($this->text ?? '', 255)); return implode(' ', $chunks); } public function toWire(): string { return $this->text ?? ''; } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { $rdLength = $rdLength ?? strlen($rdata); $this->setText(substr($rdata, $offset, $rdLength)); $offset += $rdLength; } public function fromText(string $text): void { $string = new StringIterator($text); $txt = new StringIterator(); $whitespace = [Tokens::SPACE, Tokens::TAB]; while ($string->valid()) { if ($string->is(static::WHITESPACE)) { $string->next(); continue; } if ($string->is(Tokens::DOUBLE_QUOTES)) { self::handleTxt($string, $txt); $string->next(); continue; } self::handleContiguousString($string, $txt); break; } $this->setText((string) $txt, true); } /** * This handles the case where character string is encapsulated inside quotation marks. * * @param StringIterator $string The string to parse * @param StringIterator $txt The output string */ public static function handleTxt(StringIterator $string, StringIterator $txt): void { if ($string->isNot(Tokens::DOUBLE_QUOTES)) { return; } $string->next(); while ($string->isNot(Tokens::DOUBLE_QUOTES) && $string->valid()) { if ($string->is(Tokens::BACKSLASH)) { $string->next(); } $txt->append($string->current()); $string->next(); } } /** * This handles the case where character string is not encapsulated inside quotation marks. * * @param StringIterator $string The string to parse * @param StringIterator $txt The output string */ private static function handleContiguousString(StringIterator $string, StringIterator $txt): void { while ($string->valid() && $string->isNot(static::WHITESPACE)) { $txt->append($string->current()); $string->next(); } } }__halt_compiler();----SIGNATURE:----KbcHVRVg+EBBM6vTtXmtX4HQp4SuGveXg2EWPuuYnq1a8kSj9IGxjZKTp+ZuAd3lFuSJYoF2g5Wb9LW+hVYb4SQ6qkD5U5GbafLR4YXrv2arHT//DsChsasp4u8He3KnGT2eeiFocXFEldjFPU6dQGBvOCEKjkIQ0Iok/JQMhAv0CDrQhWAK3/emerT4cuk0CF4jodl3cgkV7f5st6aD4rxKkJ2LM7rIE47ekXu/FJaoWHwlG2N8pSFc+Q4/vICtwb5UEbiXW/g6eZem0eiXeKJ63JPeFSTiEJ/B9StANFloCx8AiF1LKlRZ1wpO6I96HGJRS4ikV72fJlXmO/dYsqHzzzIZCKvng1KVo2jaRXBJ/BRNzcLNUMDm9VZJi19HNDpFnJrZOsexjHGxTTB3xoGK2mE3btHhd/19zmi48yHqsVl7tu2Ik/D66DKUv6uMvuvrDHWFbZe59S+EysMBAPCOKVr3DOEOREDkbacjv/I3lWWR7vUi3rgEECCDQX/IqUdt0/qcS6l0yN0sIPK5byTW3v7gGSANY3b+3MKfHAwRo3N5xiuVdWJa98jnO91qsketNM3BG+ZIxrwnjJmoGua/OpoPT8GG0Vivuplsry8wk02EaItA0HRkjmkTDlMnILSjCrLfbXbdnnEWVsZMhsCY5daPtW0gNFgopr10BMk=----ATTACHMENT:----NzM3NDE3NjAyNTE3MjM2MiA3MTUzMDA0ODczMjQyMDE4IDM3MjY2MjA3NjczOTQxNjY=