refactor: unify quotes encoding

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-25 11:49:18 -04:00
parent cd724df8ec
commit 09d0bbd817
11 changed files with 38 additions and 63 deletions
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace KTXM\ProviderImap\Client\Protocol\Command;
use KTXM\ProviderImap\Client\Protocol\StringEncoder;
use KTXM\ProviderImap\Client\Protocol\Parser\StatusResponseParser;
use KTXM\ProviderImap\Client\Result\StatusResult;
use KTXM\ProviderImap\Client\ImapException;
@@ -51,7 +52,7 @@ final class StatusCommand implements CommandInterface
return new RequestFrame(sprintf(
'STATUS %s (%s)',
$this->quote($this->mailbox),
StringEncoder::quote($this->mailbox),
implode(' ', $this->normalizeItems($this->items)),
));
}
@@ -112,8 +113,4 @@ final class StatusCommand implements CommandInterface
return $normalized;
}
private function quote(string $value): string
{
return '"' . addcslashes($value, "\\\"") . '"';
}
}