Code Duplication    Length = 26-27 lines in 2 locations

lib/Activity/Provider.php 2 locations

@@ 167-193 (lines=27) @@
164
	 *
165
	 * @return IEvent
166
	 */
167
	private function parseCircleCreate($lang, Circle $circle, IEvent $event) {
168
		if ($circle->getOwner()
169
				   ->getUserId() === $this->activityManager->getCurrentUserId()
170
		) {
171
			$event->setRichSubject(
172
				$this->l10n->t(
173
					'You created the circle {circle}'
174
				),
175
				['circle' => $this->generateCircleParameter($circle)]
176
			);
177
178
		} else {
179
			$event->setRichSubject(
180
				$this->l10n->t(
181
					'{author} created the circle {circle}'
182
				), [
183
					'author' => $author = $this->generateUserParameter(
184
						$circle->getOwner()
185
							   ->getUserId()
186
					),
187
					'circle' => $this->generateCircleParameter($circle)
188
				]
189
			);
190
		}
191
192
		return $event;
193
	}
194
195
196
	/**
@@ 203-228 (lines=26) @@
200
	 *
201
	 * @return IEvent
202
	 */
203
	private function parseCircleDelete($lang, Circle $circle, IEvent $event) {
204
		if ($circle->getOwner()
205
				   ->getUserId() === $this->activityManager->getCurrentUserId()
206
		) {
207
			$event->setRichSubject(
208
				$this->l10n->t(
209
					'You deleted circle {circle}'
210
				),
211
				['circle' => $this->generateCircleParameter($circle)]
212
			);
213
		} else {
214
			$event->setRichSubject(
215
				$this->l10n->t(
216
					'{author} deleted circle {circle}'
217
				), [
218
					'author' => $this->generateUserParameter(
219
						$circle->getOwner()
220
							   ->getUserId()
221
					),
222
					'circle' => $this->generateCircleParameter($circle)
223
				]
224
			);
225
		}
226
227
		return $event;
228
	}
229
230
231
	/**