Check against interface Compressor, not for methods
authorRoland Häder <roland@mxchange.org>
Thu, 29 Nov 2012 16:37:26 +0000 (16:37 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 29 Nov 2012 16:37:26 +0000 (16:37 +0000)
inc/classes/middleware/compressor/class_CompressorChannel.php

index c1b213c..8ca26e1 100644 (file)
@@ -94,10 +94,10 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                if (
                           (is_null($compressorInstance->getCompressor()))
                        || (!is_object($compressorInstance->getCompressor()))
-                       || (!method_exists($compressorInstance->getCompressor(), 'compressStream'))
-                       || (!method_exists($compressorInstance->getCompressor(), 'decompressStream'))
+                       || (!$compressorInstance instanceof Compressor)
                ) {
                        // Set the null compressor handler. This should not be configureable!
+                       // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay?
                        $compressorInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor'));
                } // END - if