Code Duplication    Length = 4-5 lines in 2 locations

core/Service/Legacy_Storage_Service_v_1_5.php 2 locations

@@ 403-406 (lines=4) @@
400
		if ( is_array( $unserialized_value ) ) {
401
			if ( isset( $unserialized_value[ Value_Set::VALUE_PROPERTY ] ) ) {
402
				// value is a key=>value array - save each property separately
403
				foreach ( $unserialized_value as $property => $value_item ) {
404
					$key = $this->key_toolset->get_storage_key( false, $hierarchy, $hierarchy_index, 0, $property );
405
					$storage_array[ $key ] = $value_item;
406
				}
407
			} else {
408
				// value is a simple array - save each value separately
409
				$i = 0;
@@ 410-414 (lines=5) @@
407
			} else {
408
				// value is a simple array - save each value separately
409
				$i = 0;
410
				foreach ( $unserialized_value as $value_item ) {
411
					$key = $this->key_toolset->get_storage_key( false, $hierarchy, $hierarchy_index, $i, Value_Set::VALUE_PROPERTY );
412
					$storage_array[ $key ] = $value_item;
413
					$i++;
414
				}
415
			}
416
		} else if ( $unserialized_value === null ) {
417
			// no value found - add a keepalive key