Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 279-286 (lines=8) @@
276
	protected function addToCache($path, $data, $fileId = -1) {
277
		\OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]);
278
		$this->emit('\OC\Files\Cache\Scanner', 'addToCache', [$path, $this->storageId, $data]);
279
		if ($this->cacheActive) {
280
			if ($fileId !== -1) {
281
				$this->cache->update($fileId, $data);
282
				return $fileId;
283
			}
284
285
			return $this->cache->put($path, $data);
286
		}
287
288
		return -1;
289
	}
@@ 301-307 (lines=7) @@
298
	protected function updateCache($path, $data, $fileId = -1) {
299
		\OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]);
300
		$this->emit('\OC\Files\Cache\Scanner', 'updateCache', [$path, $this->storageId, $data]);
301
		if ($this->cacheActive) {
302
			if ($fileId !== -1) {
303
				$this->cache->update($fileId, $data);
304
			} else {
305
				$this->cache->put($path, $data);
306
			}
307
		}
308
	}
309
310
	/**