]> git.mxchange.org Git - core.git/commitdiff
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 c1b213cfc51172e000ad4552d32c994c1842e751..8ca26e13ada068b1b91871062b2095eeaaa74384 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