]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/HTTPException.php
Posts per author/server on the community pages (#13764)
[friendica.git] / src / Network / HTTPException.php
index b6be886b35f25bf396110610cb16c776251f8fa8..c2f5c4867d43567748e7260bce85dd6623bb6ffe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,15 +31,21 @@ use Exception;
  */
 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;
        }
 }