snappymail/rainloop/v/0.0.0/app/libraries/MailSo/Imap/Response.php

96 lines
1.3 KiB
PHP
Raw Normal View History

2013-09-25 03:04:44 +08:00
<?php
namespace MailSo\Imap;
/**
* @category MailSo
* @package Imap
*/
class Response
{
/**
* @var array
*/
public $ResponseList;
/**
* @var array | null
*/
public $OptionalResponse;
/**
* @var string
*/
public $StatusOrIndex;
/**
* @var string
*/
public $HumanReadable;
/**
* @var bool
*/
public $IsStatusResponse;
/**
* @var string
*/
public $ResponseType;
/**
* @var string
*/
public $Tag;
/**
* @access private
*/
private function __construct()
{
$this->ResponseList = array();
$this->OptionalResponse = null;
$this->StatusOrIndex = '';
$this->HumanReadable = '';
$this->IsStatusResponse = false;
$this->ResponseType = \MailSo\Imap\Enumerations\ResponseType::UNKNOWN;
$this->Tag = '';
}
/**
* @return \MailSo\Imap\Response
*/
public static function NewInstance()
{
return new self();
}
2014-08-19 20:39:27 +08:00
/**
* @param string $aList
*
* @return string
*/
private function recToLine($aList)
{
$aResult = array();
if (\is_array($aList))
{
foreach ($aList as $mItem)
{
$aResult[] = \is_array($mItem) ? '('.$this->recToLine($mItem).')' : (string) $mItem;
}
}
return \implode(' ', $aResult);
}
/**
* @return string
*/
public function ToLine()
{
return $this->recToLine($this->ResponseList);
}
2013-09-25 03:04:44 +08:00
}