Code Duplication    Length = 22-22 lines in 3 locations

lib/Activity/Provider.php 3 locations

@@ 289-310 (lines=22) @@
286
	 *
287
	 * @return IEvent
288
	 */
289
	private function parseMemberRequestInvitation(
290
		$lang, Circle $circle, Member $member, IEvent $event
291
	) {
292
		if ($member->getUserId() === $this->activityManager->getCurrentUserId()) {
293
			$event->setRichSubject(
294
				$this->l10n->t('You requested an invitation to {circle}'),
295
				['circle' => $this->generateCircleParameter($circle)]
296
			);
297
298
		} else {
299
			$event->setRichSubject(
300
				$this->l10n->t(
301
					'{author} has requested an invitation into {circle}'
302
				), [
303
					'author' => $this->generateMemberParameter($member),
304
					'circle' => $this->generateCircleParameter($circle)
305
				]
306
			);
307
		}
308
309
		return $event;
310
	}
311
312
313
	/**
@@ 321-342 (lines=22) @@
318
	 *
319
	 * @return IEvent
320
	 */
321
	private function parseMemberJoin($lang, Circle $circle, Member $member, IEvent $event) {
322
		if ($circle->getUser()
323
				   ->getUserId() === $this->activityManager->getCurrentUserId()
324
		) {
325
			$event->setRichSubject(
326
				$this->l10n->t('You joined {circle}'),
327
				['circle' => $this->generateCircleParameter($circle)]
328
			);
329
330
		} else {
331
			$event->setRichSubject(
332
				$this->l10n->t(
333
					'{member} has joined the circle {circle}'
334
				), [
335
					'circle' => $this->generateCircleParameter($circle),
336
					'member' => $this->generateMemberParameter($member)
337
				]
338
			);
339
		}
340
341
		return $event;
342
	}
343
344
345
	/**
@@ 405-426 (lines=22) @@
402
	 *
403
	 * @return IEvent
404
	 */
405
	private function parseMemberLeft($lang, Circle $circle, Member $member, IEvent $event) {
406
		if ($circle->getUser()
407
				   ->getUserId() === $this->activityManager->getCurrentUserId()
408
		) {
409
			$event->setRichSubject(
410
				$this->l10n->t('You left {circle}'),
411
				['circle' => $this->generateCircleParameter($circle)]
412
			);
413
414
		} else {
415
			$event->setRichSubject(
416
				$this->l10n->t(
417
					'{member} has left {circle}'
418
				), [
419
					'circle' => $this->generateCircleParameter($circle),
420
					'member' => $this->generateMemberParameter($member)
421
				]
422
			);
423
		}
424
425
		return $event;
426
	}
427
428
429
	/**