Code Duplication    Length = 12-13 lines in 2 locations

cloudcontrol/library/storage/JsonStorage.php 2 locations

@@ 410-422 (lines=13) @@
407
		 *
408
		 * @throws \Exception
409
		 */
410
		public function saveSitemapItem($slug, $postValues)
411
		{
412
			$sitemapObject = $this->createSitemapItemFromPostValues($postValues);
413
			
414
			$sitemap = $this->repository->sitemap;
415
			foreach ($sitemap as $key => $sitemapItem) {
416
				if ($sitemapItem->slug == $slug) {
417
					$sitemap[$key] = $sitemapObject;
418
				}
419
			}
420
			$this->repository->sitemap = $sitemap;
421
			$this->save();
422
		}
423
424
		/**
425
		 * Delete a sitemap item by its slug
@@ 431-442 (lines=12) @@
428
		 *
429
		 * @throws \Exception
430
		 */
431
		public function deleteSitemapItemBySlug($slug)
432
		{
433
			$sitemap = $this->repository->sitemap;
434
			foreach ($sitemap as $key => $sitemapItem) {
435
				if ($sitemapItem->slug == $slug) {
436
					unset($sitemap[$key]);
437
				}
438
			}
439
			$sitemap = array_values($sitemap);
440
			$this->repository->sitemap = $sitemap;
441
			$this->save();
442
		}
443
444
		/**
445
		 * Create a sitemap item from post values