Code Duplication    Length = 14-17 lines in 3 locations

lib/Activity/Provider.php 3 locations

@@ 190-204 (lines=15) @@
187
	 *
188
	 * @return IEvent
189
	 */
190
	private function parseSubjectMemberJoin(IEvent &$event, Circle $circle, Member $member) {
191
		if ($circle->getType() === Circle::CIRCLES_CLOSED) {
192
			return $this->parseCircleMemberEvent(
193
				$event, $circle, $member,
194
				$this->l10n->t('You accepted the invitation to join {circle}'),
195
				$this->l10n->t('{member} accepted the invitation to join {circle}')
196
			);
197
		} else {
198
			return $this->parseCircleMemberEvent(
199
				$event, $circle, $member,
200
				$this->l10n->t('You joined {circle}'),
201
				$this->l10n->t('{member} joined {circle}')
202
			);
203
		}
204
	}
205
206
207
	/**
@@ 272-288 (lines=17) @@
269
	 *
270
	 * @return IEvent
271
	 */
272
	private function parseSubjectNonMemberLeftClosedCircle(
273
		IEvent &$event, Circle $circle, Member $member
274
	) {
275
		if ($member->getStatus() === Member::STATUS_INVITED) {
276
			return $this->parseCircleMemberEvent(
277
				$event, $circle, $member,
278
				$this->l10n->t("You declined the invitation to join {circle}"),
279
				$this->l10n->t("{member} declined an invitation to join {circle}")
280
			);
281
		}
282
283
		return $this->parseCircleMemberEvent(
284
			$event, $circle, $member,
285
			$this->l10n->t("You cancelled your request to join {circle}"),
286
			$this->l10n->t("{member} cancelled his request to join {circle}")
287
		);
288
	}
289
290
291
	/**
@@ 302-315 (lines=14) @@
299
	 *
300
	 * @return IEvent
301
	 */
302
	private function parseSubjectMemberRemove(IEvent &$event, Circle $circle, Member $member) {
303
		if ($circle->getType() === Circle::CIRCLES_CLOSED
304
			&& $member->getLevel() === Member::LEVEL_NONE) {
305
			return $this->parseSubjectNonMemberRemoveClosedCircle($event, $circle, $member);
306
307
		} else {
308
			return $this->parseCircleMemberAdvancedEvent(
309
				$event, $circle, $member,
310
				$this->l10n->t('You removed {member} from {circle}'),
311
				$this->l10n->t('You have been removed from {circle} by {author}'),
312
				$this->l10n->t('{member} has been removed from {circle} by {author}')
313
			);
314
		}
315
	}
316
317
318
	/**