Code Duplication    Length = 4-5 lines in 2 locations

core/Service/Legacy_Storage_Service.php 2 locations

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