X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fexceptions%2Fclass_FrameworkException.php;h=e6c866fd7140315ddf7c80e48e1793f66fe6e487;hb=498e6b065ce47804bff4e1073592a2cc8e28f8ef;hp=94befb3bd8773a6cde33c1a9b761693ecbe18b45;hpb=adcdfc000eba8fac128786adcb8cb480085e7e76;p=core.git diff --git a/framework/main/exceptions/class_FrameworkException.php b/framework/main/exceptions/class_FrameworkException.php index 94befb3b..e6c866fd 100644 --- a/framework/main/exceptions/class_FrameworkException.php +++ b/framework/main/exceptions/class_FrameworkException.php @@ -33,7 +33,7 @@ abstract class FrameworkException extends ReflectionException { /** * Array for the backtrace */ - private $backTrace = array(); + private $backTrace = []; /** * Extra data @@ -47,7 +47,7 @@ abstract class FrameworkException extends ReflectionException { * @param $code An optional code for better debugging * @return void */ - public function __construct ($message, $code = 0) { + public function __construct (string $message, int $code = 0) { // Make sure everything is assigned properly parent::__construct($message, $code); @@ -180,9 +180,12 @@ abstract class FrameworkException extends ReflectionException { * @param $code Integer code to encode in hex * @return $hexCode The exception code in hex-decimal format */ - public final function getHexCode ($code = NULL) { - // Get the decimal code - if (is_null($code)) $code = $this->getCode(); + public final function getHexCode (int $code = NULL) { + // Is NULL? + if (is_null($code)) { + // Get default error code + $code = $this->getCode(); + } // Format it to hex-decimal, 0x as prefix and 3 chars $hexCode = sprintf("0x%03s", dechex($code)); @@ -197,7 +200,7 @@ abstract class FrameworkException extends ReflectionException { * @param $extraData Extra data to store * @return void */ - protected final function setExtraData ($extraData) { + protected final function setExtraData (string $extraData) { $this->extraData = $extraData; }