Code Duplication    Length = 14-17 lines in 3 locations

lib/Activity/Provider.php 3 locations

@@ 161-175 (lines=15) @@
158
	 *
159
	 * @return IEvent
160
	 */
161
	private function parseSubjectMemberJoin(IEvent &$event, Circle $circle, Member $member) {
162
		if ($circle->getType() === Circle::CIRCLES_CLOSED) {
163
			return $this->parseCircleMemberEvent(
164
				$event, $circle, $member,
165
				$this->l10n->t('You accepted the invitation to join {circle}'),
166
				$this->l10n->t('{member} accepted the invitation to join {circle}')
167
			);
168
		} else {
169
			return $this->parseCircleMemberEvent(
170
				$event, $circle, $member,
171
				$this->l10n->t('You joined {circle}'),
172
				$this->l10n->t('{member} joined {circle}')
173
			);
174
		}
175
	}
176
177
178
	/**
@@ 242-258 (lines=17) @@
239
	 *
240
	 * @return IEvent
241
	 */
242
	private function parseSubjectNonMemberLeftClosedCircle(
243
		IEvent &$event, Circle $circle, Member $member
244
	) {
245
		if ($member->getStatus() === Member::STATUS_INVITED) {
246
			return $this->parseCircleMemberEvent(
247
				$event, $circle, $member,
248
				$this->l10n->t("You declined the invitation to join {circle}"),
249
				$this->l10n->t("{member} declined an invitation to join {circle}")
250
			);
251
		}
252
253
		return $this->parseCircleMemberEvent(
254
			$event, $circle, $member,
255
			$this->l10n->t("You cancelled your request to join {circle}"),
256
			$this->l10n->t("{member} cancelled his request to join {circle}")
257
		);
258
	}
259
260
261
	/**
@@ 272-285 (lines=14) @@
269
	 *
270
	 * @return IEvent
271
	 */
272
	private function parseSubjectMemberRemove(IEvent &$event, Circle $circle, Member $member) {
273
		if ($circle->getType() === Circle::CIRCLES_CLOSED
274
			&& $member->getLevel() === Member::LEVEL_NONE) {
275
			return $this->parseSubjectNonMemberRemoveClosedCircle($event, $circle, $member);
276
277
		} else {
278
			return $this->parseCircleMemberAdvancedEvent(
279
				$event, $circle, $member,
280
				$this->l10n->t('You removed {member} from {circle}'),
281
				$this->l10n->t('You have been removed from {circle} by {author}'),
282
				$this->l10n->t('{member} has been removed from {circle} by {author}')
283
			);
284
		}
285
	}
286
287
288
	/**