Code Duplication    Length = 19-20 lines in 2 locations

lib/Controller/CirclesController.php 2 locations

@@ 192-211 (lines=20) @@
189
	 * @internal param string $name
190
	 *
191
	 */
192
	public function join($id) {
193
194
		try {
195
			$data = $this->circlesService->joinCircle($id);
196
		} catch (\Exception $e) {
197
			return $this->fail(
198
				[
199
					'circle_id' => $id,
200
					'error'     => $e->getMessage()
201
				]
202
			);
203
		}
204
205
		return $this->success(
206
			[
207
				'circle_id' => $id,
208
				'member'    => $data
209
			]
210
		);
211
	}
212
213
214
	/**
@@ 224-242 (lines=19) @@
221
	 * @internal param string $name
222
	 *
223
	 */
224
	public function leave($id) {
225
		try {
226
			$data = $this->circlesService->leaveCircle($id);
227
		} catch (\Exception $e) {
228
			return $this->fail(
229
				[
230
					'circle_id' => $id,
231
					'error'     => $e->getMessage()
232
				]
233
			);
234
		}
235
236
		return $this->success(
237
			[
238
				'circle_id' => $id,
239
				'member'    => $data
240
			]
241
		);
242
	}
243
244
245
}