]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/middleware/debug/class_DebugMiddleware.php
Account status page partly implemented, backtrace now without own saveBacktrace(...
[shipsimu.git] / inc / classes / middleware / debug / class_DebugMiddleware.php
index 5c1e050d2854a092432d5d9742097a03ec331818..ed1f8d03d636f4500e957c4d42a3a8328ac22c22 100644 (file)
@@ -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
@@ -23,7 +23,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class DebugMiddleware extends BaseMiddleware {
+class DebugMiddleware extends BaseMiddleware implements Registerable {
        /**
         * The concrete output instance
         */
@@ -106,6 +106,7 @@ class DebugMiddleware extends BaseMiddleware {
         * browser or debug lines for a log file, etc. to the registered debug
         * output instance.
         *
+        * @param       $outStream      Data we shall "stream" out to the world
         * @return      void
         */
        public final function output ($outStream) {
@@ -116,7 +117,7 @@ class DebugMiddleware extends BaseMiddleware {
                } elseif (!is_object($this->outputInstance)) {
                        // The debug output instance is not an object
                        throw new NoObjectException($this->ouputInstance, self::EXCEPTION_IS_NO_OBJECT);
-               } elseif (!method_exists($this->outputInstance, 'outputStream')) {
+               } elseif (!$this->outputInstance instanceof Debugger) {
                        // The required method outputStream() is missing
                        throw new MissingMethodException(array($this->outputInstance, 'outputStream'), self::EXCEPTION_MISSING_METHOD);
                }
@@ -125,7 +126,7 @@ class DebugMiddleware extends BaseMiddleware {
                if (empty($outStream)) {
                        // Initialization phase
                        return;
-               }
+               } // END - if
 
                // Use the output instance
                $this->outputInstance->outputStream($outStream);