remove superfluous interface treatment
authorFlorian Frantzen <ray176@me.com>
Sat, 19 Sep 2015 15:16:07 +0000 (17:16 +0200)
committerFlorian Frantzen <ray176@me.com>
Sat, 19 Sep 2015 15:16:07 +0000 (17:16 +0200)
Since PHP 5.3.9, `is_subclass_of` supports checks against interfaces as
well. Therefore, the special interface treatment with `ReflectionClass`
is obsolete.

wcfsetup/install/files/lib/util/ClassUtil.class.php

index f5eca64ccf88878e506265e787f596efaae398a6..dd682286ec4dc4eefffc27d809d2f930f0c20590 100644 (file)
@@ -47,14 +47,7 @@ final class ClassUtil {
                        throw new SystemException("Cannot determine class inheritance, reference class '".$targetClass."' does not exist");
                }
                
-               // check for simple inheritance
-               if (class_exists($targetClass)) {
-                       return is_subclass_of($className, $targetClass);
-               }
-               
-               // check for interface
-               $reflectionClass = new \ReflectionClass($className);
-               return $reflectionClass->implementsInterface($targetClass);
+               return is_subclass_of($className, $targetClass);
        }
        
        private function __construct() { }