]> git.mxchange.org Git - core.git/blobdiff - framework/main/exceptions/class_FrameworkException.php
Continued:
[core.git] / framework / main / exceptions / class_FrameworkException.php
index 866e59f7d0b2f028ed5c7b84cebd34be6ab1dfbe..e6c866fd7140315ddf7c80e48e1793f66fe6e487 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Generic;
+namespace Org\Mxchange\CoreFramework\Generic;
 
 // Import SPL stuff
 use \ReflectionException;
@@ -12,7 +12,7 @@ use \ReflectionException;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -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);
 
@@ -126,7 +126,7 @@ abstract class FrameworkException extends ReflectionException {
 
                        // Are there arguments?
                        if ((isset($dbgInfo['args'])) && (is_array($dbgInfo['args'])) && (isset($dbgInfo['args'][0]))) {
-                               //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], TRUE))."</pre>";
+                               //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], true))."</pre>";
                                $info = '';
                                foreach ($dbgInfo['args'] as $debug) {
                                        // Add only non-array elements
@@ -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;
        }