Code Duplication    Length = 9-9 lines in 2 locations

apps/files_external/lib/Lib/Notify/SMBNotifyHandler.php 1 location

@@ 55-63 (lines=9) @@
52
		$this->root = $root;
53
	}
54
55
	private function relativePath($fullPath) {
56
		if ($fullPath === $this->root) {
57
			return '';
58
		} else if (substr($fullPath, 0, strlen($this->root)) === $this->root) {
59
			return substr($fullPath, strlen($this->root));
60
		} else {
61
			return null;
62
		}
63
	}
64
65
	public function listen(callable $callback) {
66
		$oldRenamePath = null;

apps/files_external/lib/Lib/Storage/SMB.php 1 location

@@ 145-153 (lines=9) @@
142
		return Filesystem::normalizePath($this->root . '/' . $path, true, false, true);
143
	}
144
145
	protected function relativePath($fullPath) {
146
		if ($fullPath === $this->root) {
147
			return '';
148
		} else if (substr($fullPath, 0, strlen($this->root)) === $this->root) {
149
			return substr($fullPath, strlen($this->root));
150
		} else {
151
			return null;
152
		}
153
	}
154
155
	/**
156
	 * @param string $path