Code Duplication    Length = 5-5 lines in 2 locations

cloudcontrol/library/storage/JsonStorage.php 2 locations

@@ 463-467 (lines=5) @@
460
				$sitemapObject->template = $postValues['template'];
461
				$sitemapObject->regex = isset($postValues['regex']);
462
				$sitemapObject->parameters = new \stdClass();
463
				if (isset($postValues['parameterNames'], $postValues['parameterValues'])) {
464
					foreach ($postValues['parameterNames'] as $key => $value) {
465
						$sitemapObject->parameters->$value = $postValues['parameterValues'][$key];
466
					}
467
				}
468
				return $sitemapObject;
469
			} else {
470
				throw new \Exception('Trying to create sitemap item with invalid data.');
@@ 1190-1194 (lines=5) @@
1187
				$applicationComponent->slug = slugify($postValues['title']);
1188
				$applicationComponent->component = $postValues['component'];
1189
				$applicationComponent->parameters = new \stdClass();
1190
				if (isset($postValues['parameterNames'], $postValues['parameterValues'])) {
1191
					foreach ($postValues['parameterNames'] as $key => $value) {
1192
						$applicationComponent->parameters->$value = $postValues['parameterValues'][$key];
1193
					}
1194
				}
1195
				return $applicationComponent;
1196
			} else {
1197
				throw new \Exception('Trying to create application component with invalid data.');