Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

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