Code Duplication    Length = 12-13 lines in 2 locations

cloudcontrol/library/storage/JsonStorage.php 2 locations

@@ 1261-1273 (lines=13) @@
1258
			return null;
1259
		}
1260
1261
		public function saveApplicationComponent($slug, $postValues)
1262
		{
1263
			$newApplicationComponent = $this->createApplicationComponentFromPostValues($postValues);
1264
1265
			$applicationComponents = $this->getApplicationComponents();
1266
			foreach ($applicationComponents as $key => $applicationComponent) {
1267
				if ($applicationComponent->slug == $slug) {
1268
					$applicationComponents[$key] = $newApplicationComponent;
1269
				}
1270
			}
1271
			$this->repository->applicationComponents = $applicationComponents;
1272
			$this->save();
1273
		}
1274
1275
		public function deleteApplicationComponentBySlug($slug)
1276
		{
@@ 1275-1286 (lines=12) @@
1272
			$this->save();
1273
		}
1274
1275
		public function deleteApplicationComponentBySlug($slug)
1276
		{
1277
			$applicationComponents = $this->getApplicationComponents();
1278
			foreach ($applicationComponents as $key => $applicationComponent) {
1279
				if ($applicationComponent->slug == $slug) {
1280
					unset($applicationComponents[$key]);
1281
				}
1282
			}
1283
			$applicationComponents = array_values($applicationComponents);
1284
			$this->repository->applicationComponents = $applicationComponents;
1285
			$this->save();
1286
		}
1287
	}
1288
}