Code Duplication    Length = 10-10 lines in 2 locations

apps/files_versions/lib/hooks.php 2 locations

@@ 102-111 (lines=10) @@
99
	 * This function is connected to the rename signal of OC_Filesystem and adjust the name and location
100
	 * of the stored versions along the actual file
101
	 */
102
	public static function rename_hook($params) {
103
104
		if (\OCP\App::isEnabled('files_versions')) {
105
			$oldpath = $params['oldpath'];
106
			$newpath = $params['newpath'];
107
			if($oldpath<>'' && $newpath<>'') {
108
				Storage::renameOrCopy($oldpath, $newpath, 'rename');
109
			}
110
		}
111
	}
112
113
	/**
114
	 * copy versions of copied files
@@ 120-129 (lines=10) @@
117
	 * This function is connected to the copy signal of OC_Filesystem and copies the
118
	 * the stored versions to the new location
119
	 */
120
	public static function copy_hook($params) {
121
122
		if (\OCP\App::isEnabled('files_versions')) {
123
			$oldpath = $params['oldpath'];
124
			$newpath = $params['newpath'];
125
			if($oldpath<>'' && $newpath<>'') {
126
				Storage::renameOrCopy($oldpath, $newpath, 'copy');
127
			}
128
		}
129
	}
130
131
	/**
132
	 * Remember owner and the owner path of the source file.