From: Roland Häder Date: Sat, 11 Feb 2012 00:08:16 +0000 (+0000) Subject: Some minor rewrites X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=1d0f8e0fa7346ab3df9d0ee44c4c957047711ddc Some minor rewrites --- diff --git a/inc/classes/exceptions/socket/class_InvalidSocketException.php b/inc/classes/exceptions/socket/class_InvalidSocketException.php index e7de2fb3..a8fbb889 100644 --- a/inc/classes/exceptions/socket/class_InvalidSocketException.php +++ b/inc/classes/exceptions/socket/class_InvalidSocketException.php @@ -45,9 +45,10 @@ class InvalidSocketException extends AbstractSocketException { ); } else { // Construct the message - $message = sprintf("[%s:] Invalid socket, type=%s, errno=%s, errstr=%s", + $message = sprintf("[%s:] Invalid socket, type=%s(%s), errno=%s, errstr=%s", $messageData[0]->__toString(), $messageData[1], + gettype($messageData[1]), $messageData[2], $messageData[3] ); diff --git a/inc/classes/exceptions/socket/class_NoSocketErrorDetectedException.php b/inc/classes/exceptions/socket/class_NoSocketErrorDetectedException.php index 1a5db636..8217ad44 100644 --- a/inc/classes/exceptions/socket/class_NoSocketErrorDetectedException.php +++ b/inc/classes/exceptions/socket/class_NoSocketErrorDetectedException.php @@ -35,7 +35,7 @@ class NoSocketErrorDetectedException extends AbstractSocketException { // Construct the message $message = sprintf("[%s:] Socket %s has no error reported.", $messageData[0]->__toString(), - $messageData[1], + $messageData[1] ); // Call parent exception constructor diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index fcd7dab7..10ce072b 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -364,10 +364,19 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Add the type $argsString .= $this->replaceControlCharacters($arg) . ' (' . gettype($arg); - // Add length if type is string if (is_string($arg)) { + // Add length for strings $argsString .= ', '.strlen($arg); - } // END - if + } elseif (is_array($arg)) { + // .. or size if array + $argsString .= ', '.count($arg); + } elseif ($arg === true) { + // ... is boolean 'true' + $argsString .= ', true'; + } elseif ($arg === false) { + // ... is boolean 'true' + $argsString .= ', false'; + } // Closing bracket $argsString .= '), '; diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index 7c3e29df..ad605ce7 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -679,7 +679,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // Get last executed pre filter $extraInstance = Registry::getRegistry()->getInstance('extra'); } catch (NullPointerException $e) { - // Instance in registry is not set (null) + // Instance in registry is not set (NULL) // @TODO We need to log this later } diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index c0728738..24c2ee34 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -179,7 +179,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { public function closeDirectory () { // Close the directory pointer and reset the instance variable @closedir($this->getPointer()); - $this->setPointer(null); + $this->setPointer(NULL); $this->setPathName(''); } diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index f1d0b9e4..c7a6ad17 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -162,7 +162,7 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { // Close the file pointer and reset the instance variable @fclose($this->getPointer()); - $this->setPointer(null); + $this->setPointer(NULL); $this->setFileName(''); } diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index 5fb5e751..0b05f8c4 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -132,7 +132,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { // Close the file pointer and reset the instance variable @fclose($this->getPointer()); - $this->setPointer(null); + $this->setPointer(NULL); $this->setFileName(''); } diff --git a/inc/classes/main/stacker/class_BaseStacker.php b/inc/classes/main/stacker/class_BaseStacker.php index 1bfd8806..ea31904d 100644 --- a/inc/classes/main/stacker/class_BaseStacker.php +++ b/inc/classes/main/stacker/class_BaseStacker.php @@ -104,7 +104,7 @@ class BaseStacker extends BaseFrameworkSystem { /** * Checks wether the given stack is empty * - * @param $stackerName Name of the stack + * @param $stackerName Name of the stack * @return $isEmpty Wether the stack is empty * @throws NoStackerException If given stack is missing */ @@ -116,10 +116,10 @@ class BaseStacker extends BaseFrameworkSystem { } // END - if // So, is the stack empty? - $isFull = (($this->getStackCount($stackerName)) == 0); + $isEmpty = (($this->getStackCount($stackerName)) == 0); // Return result - return $isFull; + return $isEmpty; } /**