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

@@ 134-142 (lines=9) @@
131
		return Filesystem::normalizePath($this->root . '/' . $path, true, false, true);
132
	}
133
134
	protected function relativePath($fullPath) {
135
		if ($fullPath === $this->root) {
136
			return '';
137
		} else if (substr($fullPath, 0, strlen($this->root)) === $this->root) {
138
			return substr($fullPath, strlen($this->root));
139
		} else {
140
			return null;
141
		}
142
	}
143
144
	/**
145
	 * @param string $path