Since PHP 5.3.9, `is_subclass_of` supports checks against interfaces as
well. Therefore, the special interface treatment with `ReflectionClass`
is obsolete.
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() { }