snappymail/rainloop/v/0.0.0/app/libraries/MailSo/Smtp/Exceptions/ResponseException.php
djmaze f6fdb69c65 Changed: MailSo\*Collection now extends \ArrayObject
Changed: fixed __constructor param type hinting
Replace: &$o with $o as objects don't need & referencing
2020-03-18 23:14:00 +01:00

45 lines
929 B
PHP

<?php
/*
* This file is part of MailSo.
*
* (c) 2014 Usenko Timur
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace MailSo\Smtp\Exceptions;
/**
* @category MailSo
* @package Smtp
* @subpackage Exceptions
*/
class ResponseException extends \MailSo\Smtp\Exceptions\Exception
{
/**
* @var array
*/
private $aResponses;
public function __construct(array $aResponses = array(), string $sMessage = '', int $iCode = 0, ?\Throwable $oPrevious = null)
{
parent::__construct($sMessage, $iCode, $oPrevious);
if (is_array($aResponses))
{
$this->aResponses = $aResponses;
}
}
public function GetResponses() : array
{
return $this->aResponses;
}
public function GetLastResponse() : ?\MailSo\Smtp\Response
{
return 0 < count($this->aResponses) ? $this->aResponses[count($this->aResponses) - 1] : null;
}
}