Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 266-274 (lines=9) @@
263
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkSecure', 'no') === 'yes' && $wopi->getHideDownload()) {
264
				return true;
265
			}
266
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkTags', 'no') === 'yes') {
267
				$tags = $this->appConfig->getAppValueArray('watermark_linkTagsList');
268
				$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
269
				foreach ($fileTags as $tagId) {
270
					if (in_array($tagId, $tags, true)) {
271
						return true;
272
					}
273
				}
274
			}
275
		} else {
276
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareAll', 'no') === 'yes') {
277
				$files = $this->rootFolder->getUserFolder($userId)->getById($fileId);
@@ 294-302 (lines=9) @@
291
				}
292
			}
293
		}
294
		if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_allTags', 'no') === 'yes') {
295
			$tags = $this->appConfig->getAppValueArray('watermark_allTagsList');
296
			$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
297
			foreach ($fileTags as $tagId) {
298
				if (in_array($tagId, $tags, true)) {
299
					return true;
300
				}
301
			}
302
		}
303
304
		return false;
305
	}