Code Duplication    Length = 10-15 lines in 2 locations

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(

apps/files_trashbin/lib/Trashbin.php 1 location

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