Code Duplication    Length = 11-11 lines in 7 locations

apps/files_sharing/lib/Activity/Providers/Base.php 1 location

@@ 160-170 (lines=11) @@
157
	 * @param string $uid
158
	 * @return array
159
	 */
160
	protected function getUser($uid) {
161
		if (!isset($this->displayNames[$uid])) {
162
			$this->displayNames[$uid] = $this->getDisplayName($uid);
163
		}
164
165
		return [
166
			'type' => 'user',
167
			'id' => $uid,
168
			'name' => $this->displayNames[$uid],
169
		];
170
	}
171
172
	/**
173
	 * @param string $uid

apps/files/lib/Activity/Provider.php 1 location

@@ 374-384 (lines=11) @@
371
	 * @param string $uid
372
	 * @return array
373
	 */
374
	protected function getUser($uid) {
375
		if (!isset($this->displayNames[$uid])) {
376
			$this->displayNames[$uid] = $this->getDisplayName($uid);
377
		}
378
379
		return [
380
			'type' => 'user',
381
			'id' => $uid,
382
			'name' => $this->displayNames[$uid],
383
		];
384
	}
385
386
	/**
387
	 * @param string $uid

apps/sharebymail/lib/Activity.php 1 location

@@ 292-302 (lines=11) @@
289
	 * @param string $uid
290
	 * @return array
291
	 */
292
	protected function generateUserParameter($uid) {
293
		if (!isset($this->displayNames[$uid])) {
294
			$this->displayNames[$uid] = $this->getDisplayName($uid);
295
		}
296
297
		return [
298
			'type' => 'user',
299
			'id' => $uid,
300
			'name' => $this->displayNames[$uid],
301
		];
302
	}
303
304
	/**
305
	 * @param string $email

apps/systemtags/lib/Activity/Provider.php 1 location

@@ 308-318 (lines=11) @@
305
		];
306
	}
307
308
	protected function getUserParameter($uid) {
309
		if (!isset($this->displayNames[$uid])) {
310
			$this->displayNames[$uid] = $this->getDisplayName($uid);
311
		}
312
313
		return [
314
			'type' => 'user',
315
			'id' => $uid,
316
			'name' => $this->displayNames[$uid],
317
		];
318
	}
319
320
	protected function generatePlainSystemTag(array $parameter) {
321
		if ($parameter['assignable'] === '1') {

settings/Activity/Provider.php 1 location

@@ 164-174 (lines=11) @@
161
	 * @param string $uid
162
	 * @return array
163
	 */
164
	protected function generateUserParameter($uid) {
165
		if (!isset($this->displayNames[$uid])) {
166
			$this->displayNames[$uid] = $this->getDisplayName($uid);
167
		}
168
169
		return [
170
			'type' => 'user',
171
			'id' => $uid,
172
			'name' => $this->displayNames[$uid],
173
		];
174
	}
175
176
	/**
177
	 * @param string $uid

apps/dav/lib/CalDAV/Activity/Provider/Base.php 1 location

@@ 129-139 (lines=11) @@
126
	 * @param string $uid
127
	 * @return array
128
	 */
129
	protected function generateUserParameter($uid) {
130
		if (!isset($this->displayNames[$uid])) {
131
			$this->displayNames[$uid] = $this->getDisplayName($uid);
132
		}
133
134
		return [
135
			'type' => 'user',
136
			'id' => $uid,
137
			'name' => $this->displayNames[$uid],
138
		];
139
	}
140
141
	/**
142
	 * @param string $uid

apps/comments/lib/Activity/Provider.php 1 location

@@ 249-259 (lines=11) @@
246
	 * @param string $uid
247
	 * @return array
248
	 */
249
	protected function generateUserParameter($uid) {
250
		if (!isset($this->displayNames[$uid])) {
251
			$this->displayNames[$uid] = $this->getDisplayName($uid);
252
		}
253
254
		return [
255
			'type' => 'user',
256
			'id' => $uid,
257
			'name' => $this->displayNames[$uid],
258
		];
259
	}
260
261
	/**
262
	 * @param string $uid