Code Duplication    Length = 5-8 lines in 2 locations

core/Datastore/Widget_Datastore.php 1 location

@@ 52-56 (lines=5) @@
49
	 */
50
	protected function get_storage_array( Field $field, $storage_key_patterns ) {
51
		$storage_array = array();
52
		foreach ( $this->storage as $storage_key => $value ) {
53
			if ( $this->key_toolset->storage_key_matches_any_pattern( $storage_key, $storage_key_patterns ) ) {
54
				$storage_array[] = (object) array(
55
					'key' => $storage_key,
56
					'value' => $value,
57
				);
58
			}
59
		}

core/Service/Legacy_Storage_Service.php 1 location

@@ 466-473 (lines=8) @@
463
	public function get_storage_array( Datastore_Interface $datastore, $storage_key_patterns ) {
464
		$storage_array = $this->get_storage_array_for_datastore( $datastore );
465
		$matched_data = array();
466
		foreach ( $storage_array as $key => $value ) {
467
			if ( $this->key_toolset->storage_key_matches_any_pattern( $key, $storage_key_patterns ) ) {
468
				$matched_data[] = (object) array(
469
					'key' => $key,
470
					'value' => $value,
471
				);
472
			}
473
		}
474
		return $matched_data;
475
	}
476