Some minor rewrites
authorRoland Häder <roland@mxchange.org>
Sat, 11 Feb 2012 00:08:16 +0000 (00:08 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 11 Feb 2012 00:08:16 +0000 (00:08 +0000)
inc/classes/exceptions/socket/class_InvalidSocketException.php
inc/classes/exceptions/socket/class_NoSocketErrorDetectedException.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/helper/web/forms/class_WebFormHelper.php
inc/classes/main/io/class_FrameworkDirectoryPointer.php
inc/classes/main/io/class_FrameworkFileInputPointer.php
inc/classes/main/io/class_FrameworkFileOutputPointer.php
inc/classes/main/stacker/class_BaseStacker.php

index e7de2fb..a8fbb88 100644 (file)
@@ -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]
                        );
index 1a5db63..8217ad4 100644 (file)
@@ -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
index fcd7dab..10ce072 100644 (file)
@@ -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 .= '), ';
index 7c3e29d..ad605ce 100644 (file)
@@ -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
                }
 
index c072873..24c2ee3 100644 (file)
@@ -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('');
        }
 
index f1d0b9e..c7a6ad1 100644 (file)
@@ -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('');
        }
 
index 5fb5e75..0b05f8c 100644 (file)
@@ -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('');
        }
 
index 1bfd880..ea31904 100644 (file)
@@ -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;
        }
 
        /**