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

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