function isSupertype($class, $type) { $supertypes = array_merge(array($class), static::$reflection->interfacesOf($class), static::$reflection->parentsOf($class)); return in_array($type, $supertypes); }