Code Duplication    Length = 17-18 lines in 2 locations

src/Controller/Anime.php 1 location

@@ 273-289 (lines=17) @@
270
	 *
271
	 * @return void
272
	 */
273
	public function delete()
274
	{
275
		$body = $this->request->getParsedBody();
276
		$response = $this->model->deleteLibraryItem($body['id'], $body['mal_id']);
277
278
		if ((bool)$response === TRUE)
279
		{
280
			$this->set_flash_message("Successfully deleted anime.", 'success');
281
			$this->cache->clear();
282
		}
283
		else
284
		{
285
			$this->set_flash_message('Failed to delete anime.', 'error');
286
		}
287
288
		$this->session_redirect();
289
	}
290
291
	/**
292
	 * View details of an anime

src/Controller/Manga.php 1 location

@@ 244-261 (lines=18) @@
241
	 *
242
	 * @return void
243
	 */
244
	public function delete()
245
	{
246
		$body = $this->request->getParsedBody();
247
		$id = $body['id'];
248
		$response = $this->model->deleteLibraryItem($id);
249
250
		if ($response)
251
		{
252
			$this->set_flash_message("Successfully deleted manga.", 'success');
253
			$this->cache->clear();
254
		}
255
		else
256
		{
257
			$this->set_flash_message('Failed to delete manga.', 'error');
258
		}
259
260
		$this->session_redirect();
261
	}
262
263
	/**
264
	 * View details of an manga