Code Duplication    Length = 12-12 lines in 2 locations

includes/abstracts/abstract-wc-item.php 1 location

@@ 87-98 (lines=12) @@
84
	 * offsetUnset for ArrayAccess
85
	 * @param string $offset
86
	 */
87
	public function offsetUnset( $offset ) {
88
		if ( 'item_meta_array' === $offset || 'item_meta' === $offset ) {
89
			$this->meta_data = array();
90
			return;
91
		}
92
93
		if ( array_key_exists( $offset, $this->data ) ) {
94
			unset( $this->data[ $offset ] );
95
		}
96
97
		$this->delete_meta_data( '_' . $offset );
98
	}
99
100
	/**
101
	 * offsetExists for ArrayAccess

includes/class-wc-order-item.php 1 location

@@ 339-350 (lines=12) @@
336
	 * offsetUnset for ArrayAccess
337
	 * @param string $offset
338
	 */
339
	public function offsetUnset( $offset ) {
340
		if ( 'item_meta_array' === $offset || 'item_meta' === $offset ) {
341
			$this->meta_data = array();
342
			return;
343
		}
344
345
		if ( array_key_exists( $offset, $this->data ) ) {
346
			unset( $this->data[ $offset ] );
347
		}
348
349
		$this->delete_meta_data( '_' . $offset );
350
	}
351
352
	/**
353
	 * offsetExists for ArrayAccess