/**
* Array for the backtrace
*/
- private $backTrace = array();
+ private $backTrace = [];
/**
* Extra data
* @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);
* @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));
* @param $extraData Extra data to store
* @return void
*/
- protected final function setExtraData ($extraData) {
+ protected final function setExtraData (string $extraData) {
$this->extraData = $extraData;
}