Code Duplication    Length = 10-15 lines in 2 locations

apps/files_trashbin/lib/Trashbin.php 1 location

@@ 1008-1022 (lines=15) @@
1005
	/**
1006
	 * Register listeners
1007
	 */
1008
	public function registerListeners() {
1009
		$this->eventDispatcher->addListener(
1010
			'files.resolvePrivateLink',
1011
			function (GenericEvent $event) {
1012
				$uid = $event->getArgument('uid');
1013
				$fileId = $event->getArgument('fileid');
1014
1015
				$link = $this->resolvePrivateLink($uid, $fileId);
1016
1017
				if ($link !== null) {
1018
					$event->setArgument('resolvedWebLink', $link);
1019
				}
1020
			}
1021
		);
1022
	}
1023
1024
	/**
1025
	 * register hooks

apps/files_sharing/lib/Hooks.php 1 location

@@ 112-121 (lines=10) @@
109
	public function registerListeners() {
110
		$this->eventDispatcher->addListener(
111
			'files.resolvePrivateLink',
112
			function (GenericEvent $event) {
113
				$uid = $event->getArgument('uid');
114
				$fileId = $event->getArgument('fileid');
115
116
				$link = $this->resolvePrivateLink($uid, $fileId);
117
118
				if ($link !== null) {
119
					$event->setArgument('resolvedWebLink', $link);
120
				}
121
			}
122
		);
123
124
		$this->eventDispatcher->addListener(