X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fexceptions%2Fclass_FrameworkException.php;h=2c403966037f736c9be75a5e2a37870ee8a6f04f;hb=660ab9f970714bd7c6aa5acd567f989e5ec616c6;hp=b7db9a34d639f6d45751144c9f0821de1391cd30;hpb=00fcfb8b9d95b22a000332cbe6c774bbbb15ed7a;p=hub.git diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php index b7db9a34d..2c4039660 100644 --- a/inc/classes/exceptions/class_FrameworkException.php +++ b/inc/classes/exceptions/class_FrameworkException.php @@ -8,7 +8,7 @@ * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.ship-simu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ abstract class FrameworkException extends ReflectionException { $message = (string) $message; $code = (int) $code; - // make sure everything is assigned properly + // Make sure everything is assigned properly parent::__construct($message, $code); } @@ -78,11 +78,12 @@ abstract class FrameworkException extends ReflectionException { /** * Getter for hex-decimal code * + * @param $code Integer code to encode in hex * @return $hexCode The exception code in hex-decimal format */ - public final function getHexCode () { + public final function getHexCode ($code = null) { // Get the decimal code - $code = $this->getCode(); + if (is_null($code)) $code = $this->getCode(); // Format it to hex-decimal, 0x as prefix and 3 chars $hexCode = sprintf("0x%03s", dechex($code));