Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 258-266 (lines=9) @@
255
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkSecure', 'no') === 'yes' && $wopi->getHideDownload()) {
256
				return true;
257
			}
258
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkTags', 'no') === 'yes') {
259
				$tags = $this->appConfig->getAppValueArray('watermark_linkTagsList');
260
				$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
261
				foreach ($fileTags as $tagId) {
262
					if (in_array($tagId, $tags, true)) {
263
						return true;
264
					}
265
				}
266
			}
267
		} else {
268
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareAll', 'no') === 'yes') {
269
				$files = $this->rootFolder->getUserFolder($userId)->getById($fileId);
@@ 286-294 (lines=9) @@
283
				}
284
			}
285
		}
286
		if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_allTags', 'no') === 'yes') {
287
			$tags = $this->appConfig->getAppValueArray('watermark_allTagsList');
288
			$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
289
			foreach ($fileTags as $tagId) {
290
				if (in_array($tagId, $tags, true)) {
291
					return true;
292
				}
293
			}
294
		}
295
296
		return false;
297
	}