From: Florian Frantzen Date: Sat, 19 Sep 2015 15:16:07 +0000 (+0200) Subject: remove superfluous interface treatment X-Git-Tag: 3.0.0_Beta_1~2126^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=937f8cb9eb3dd18f2a93f221483a77871bd732ef;p=GitHub%2FWoltLab%2FWCF.git remove superfluous interface treatment Since PHP 5.3.9, `is_subclass_of` supports checks against interfaces as well. Therefore, the special interface treatment with `ReflectionClass` is obsolete. --- diff --git a/wcfsetup/install/files/lib/util/ClassUtil.class.php b/wcfsetup/install/files/lib/util/ClassUtil.class.php index f5eca64ccf..dd682286ec 100644 --- a/wcfsetup/install/files/lib/util/ClassUtil.class.php +++ b/wcfsetup/install/files/lib/util/ClassUtil.class.php @@ -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() { }