X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FHTTPException.php;h=7ef1ca9828aca0e93147106f2f12d19cc716e68d;hb=db82bdfc44b09e7dfa872fb7ccca2b9571c38083;hp=89c447b71470ecd302b86ae8f2f105c42c4969b2;hpb=c1f99c70b1c7d62120723f3b142e843ba25ab338;p=friendica.git diff --git a/src/Network/HTTPException.php b/src/Network/HTTPException.php index 89c447b714..7ef1ca9828 100644 --- a/src/Network/HTTPException.php +++ b/src/Network/HTTPException.php @@ -1,27 +1,51 @@ . * - * This list of Exception has been extracted from - * here http://racksburg.com/choosing-an-http-status-code/ */ namespace Friendica\Network; use Exception; +/** + * Throwable exceptions to return HTTP status code + * + * This list of Exception has been extracted from + * here http://racksburg.com/choosing-an-http-status-code/ + */ abstract class HTTPException extends Exception { - public $httpdesc = ''; + protected $httpdesc = ''; + protected $explanation = ''; - public function __construct($message = '', Exception $previous = null) + public function __construct(string $message = '', Exception $previous = null) { parent::__construct($message, $this->code, $previous); + } - if (empty($this->httpdesc)) { - $classname = str_replace('Exception', '', str_replace('Friendica\Network\HTTPException\\', '', get_class($this))); - $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', $classname); - } + public function getDescription() + { + return $this->httpdesc; + } + + public function getExplanation() + { + return $this->explanation; } }