- md5
- 28071278f759866d7afa13e769fc0637
- sha1
- 7df1068376732a633861f544b1fdf81a7270b6a2
- sha256
- bfe4a81c625edb321b1b32de1c819928de49c85905d2b417c7142a219f8dbb04
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Mail\Exception;
/**
* Exception class defining an error for disabled mail functionality.
*
* @since 4.0.0
*/
final class MailDisabledException extends \RuntimeException
{
/**
* Send Mail option is disabled by the user.
*
* @var string
* @since 4.0.0
*/
public const REASON_USER_DISABLED = 'user_disabled';
/**
* Mail() function is not available on the system.
*
* @var string
* @since 4.0.0
*/
public const REASON_MAIL_FUNCTION_NOT_AVAILABLE = 'mail_function_not_available';
/**
* Reason mail is disabled.
*
* @var string
* @since 4.0.0
*/
private $reason;
/**
* Constructor.
*
* @param string $reason The reason why mail is disabled.
* @param string $message The Exception message to throw.
* @param integer $code The Exception code.
* @param \Throwable $previous The previous exception used for the exception chaining.
*
* @since 4.0.0
*/
public function __construct(string $reason, string $message = '', int $code = 0, \Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->reason = $reason;
}
/**
* Method to return the reason why mail is disabled.
*
* @return string
*
* @since 4.0.0
*/
public function getReason(): string
{
return $this->reason;
}
}
The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.