From 937f8cb9eb3dd18f2a93f221483a77871bd732ef Mon Sep 17 00:00:00 2001 From: Florian Frantzen Date: Sat, 19 Sep 2015 17:16:07 +0200 Subject: [PATCH] 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. --- wcfsetup/install/files/lib/util/ClassUtil.class.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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() { } -- 2.20.1