Now use 'instanceof' keyword instead of checking for existing methods
authorRoland Häder <roland@mxchange.org>
Sun, 2 Sep 2012 11:53:31 +0000 (11:53 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 2 Sep 2012 11:53:31 +0000 (11:53 +0000)
inc/classes/middleware/compressor/class_CompressorChannel.php

index 81b2fff..c1b213c 100644 (file)
@@ -49,9 +49,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                // Is the compressor handler set?
                if (
                           (is_null($compressorInstance->getCompressor()))
-                       || (!is_object($compressorInstance->getCompressor()))
-                       || (!method_exists($compressorInstance->getCompressor(), 'compressStream'))
-                       || (!method_exists($compressorInstance->getCompressor(), 'decompressStream'))
+                       || (!$compressorInstance->getCompressor() instanceof Compressor)
                ) {
                        // Init base directory
                        $baseDir =