Code Duplication    Length = 7-10 lines in 2 locations

lib/private/files/cache/scanner.php 2 locations

@@ 222-231 (lines=10) @@
219
	protected function addToCache($path, $data, $fileId = -1) {
220
		\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
221
		$this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
222
		if ($this->cacheActive) {
223
			if ($fileId !== -1) {
224
				$this->cache->update($fileId, $data);
225
				return $fileId;
226
			} else {
227
				return $this->cache->put($path, $data);
228
			}
229
		} else {
230
			return -1;
231
		}
232
	}
233
234
	/**
@@ 242-248 (lines=7) @@
239
	protected function updateCache($path, $data, $fileId = -1) {
240
		\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
241
		$this->emit('\OC\Files\Cache\Scanner', 'updateCache', array($path, $this->storageId, $data));
242
		if ($this->cacheActive) {
243
			if ($fileId !== -1) {
244
				$this->cache->update($fileId, $data);
245
			} else {
246
				$this->cache->put($path, $data);
247
			}
248
		}
249
	}
250
251
	/**