]> git.mxchange.org Git - hub.git/commitdiff
decodedData is an array and needs some assertitions on array elements.
authorRoland Haeder <roland@mxchange.org>
Sun, 16 Feb 2014 01:08:10 +0000 (02:08 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 16 Feb 2014 01:08:10 +0000 (02:08 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/main/decoder/package/class_PackageDecoder.php

index 5bb4abf3e1839e805604f762e992afc405e1463c..e8010141e760c5e9b0b4c390ca9c81982baf5186 100644 (file)
@@ -73,7 +73,7 @@ class PackageDecoder extends BaseDecoder implements Decodeable {
                $unhandledDataLeft = (!$this->getHandlerInstance()->getStackerInstance()->isStackEmpty(ChunkHandler::STACKER_NAME_ASSEMBLED_RAW_DATA));
 
                // Return it
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: unhandledDataLeft=' . intval($unhandledDataLeft));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: unhandledDataLeft=' . intval($unhandledDataLeft));
                return $unhandledDataLeft;
        }
 
@@ -95,8 +95,11 @@ class PackageDecoder extends BaseDecoder implements Decodeable {
                // "Decode" the raw package content by using the NetworkPackage instance
                $decodedData = $this->getPackageInstance()->decodeRawContent($rawPackageContent);
 
+               // Some checks
+               assert(is_array($decodedData));
+
                // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData()=' . strlen($decodedData) . ' ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('PACKAGE-DECODER[' . __METHOD__ . ':' . __LINE__ . ']: decodedData(' . count($decodedData) . ')=' . print_r($decodedData, TRUE));
 
                // Next get a recipient-discovery instance
                $discoveryInstance = PackageDiscoveryFactory::createPackageDiscoveryInstance();