Code Duplication    Length = 7-10 lines in 2 locations

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

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