Code Duplication    Length = 9-9 lines in 2 locations

apps/files_versions/lib/hooks.php 2 locations

@@ 56-64 (lines=9) @@
53
	/**
54
	 * listen to write event.
55
	 */
56
	public static function write_hook( $params ) {
57
58
		if (\OCP\App::isEnabled('files_versions')) {
59
			$path = $params[\OC\Files\Filesystem::signal_param_path];
60
			if($path<>'') {
61
				Storage::store($path);
62
			}
63
		}
64
	}
65
66
67
	/**
@@ 74-82 (lines=9) @@
71
	 * This function is connected to the delete signal of OC_Filesystem
72
	 * cleanup the versions directory if the actual file gets deleted
73
	 */
74
	public static function remove_hook($params) {
75
76
		if (\OCP\App::isEnabled('files_versions')) {
77
			$path = $params[\OC\Files\Filesystem::signal_param_path];
78
			if($path<>'') {
79
				Storage::delete($path);
80
			}
81
		}
82
	}
83
84
	/**
85
	 * mark file as "deleted" so that we can clean up the versions if the file is gone