Code Duplication    Length = 9-9 lines in 2 locations

lib/Controller/WopiController.php 2 locations

@@ 253-261 (lines=9) @@
250
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkSecure', 'no') === 'yes' && $wopi->getHideDownload()) {
251
				return true;
252
			}
253
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_linkTags', 'no') === 'yes') {
254
				$tags = $this->appConfig->getAppValueArray('watermark_linkTagsList');
255
				$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files')[$fileId];
256
				foreach ($fileTags as $tagId) {
257
					if (in_array($tagId, $tags, true)) {
258
						return true;
259
					}
260
				}
261
			}
262
		} else {
263
			if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_shareAll', 'no') === 'yes') {
264
				return true;
@@ 278-286 (lines=9) @@
275
				}
276
			}
277
		}
278
		if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_allTags', 'no') === 'yes') {
279
			$tags = $this->appConfig->getAppValueArray('watermark_allTagsList');
280
			$fileTags = \OC::$server->getSystemTagObjectMapper()->getTagIdsForObjects([$fileId], 'files');
281
			foreach ($fileTags as $tagId) {
282
				if (in_array($tagId, $tags)) {
283
					return true;
284
				}
285
			}
286
		}
287
288
		return false;
289
	}