public static function clear($class = null, $method = null) {
		if ($class === null && $method === null) {
			static::$_filters = static::$_chains = [];
			return;
		}

		if (is_string($class)) {
			$regex  = '^<' . str_replace('\\', '\\\\', ltrim($class, '\\')) . '.*>';
		} else {
			$regex  = '^<.*#' . spl_object_hash($class) . '>';
		}
		if ($method) {
			$regex .= "::{$method}$";
		}
		foreach (preg_grep("/{$regex}/", array_keys(static::$_filters)) as $id) {
			unset(static::$_filters[$id]);
		}
		foreach (preg_grep("/{$regex}/", array_keys(static::$_chains)) as $id) {
			unset(static::$_chains[$id]);
		}
	}