Code Duplication    Length = 7-10 lines in 2 locations

lib/private/Files/Cache/Scanner.php 2 locations

@@ 287-296 (lines=10) @@
284
		}
285
		\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
286
		$this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
287
		if ($this->cacheActive) {
288
			if ($fileId !== -1) {
289
				$this->cache->update($fileId, $data);
290
				return $fileId;
291
			} else {
292
				return $this->cache->put($path, $data);
293
			}
294
		} else {
295
			return -1;
296
		}
297
	}
298
299
	/**
@@ 307-313 (lines=7) @@
304
	protected function updateCache($path, $data, $fileId = -1) {
305
		\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
306
		$this->emit('\OC\Files\Cache\Scanner', 'updateCache', array($path, $this->storageId, $data));
307
		if ($this->cacheActive) {
308
			if ($fileId !== -1) {
309
				$this->cache->update($fileId, $data);
310
			} else {
311
				$this->cache->put($path, $data);
312
			}
313
		}
314
	}
315
316
	/**