Code Duplication    Length = 13-14 lines in 2 locations

core/helpers/EEH_Debug_Tools.helper.php 1 location

@@ 385-398 (lines=14) @@
382
		foreach ( $info as $key => $value ) {
383
			if ( is_array( $value ) ) {
384
				$info[ $key ] = self::strip_objects( $value );
385
			} else if ( is_object( $value ) ) {
386
				$object_class = get_class( $value );
387
				$info[ $object_class ] = array();
388
				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : spl_object_hash( $value );
389
				if ( method_exists( $value, 'ID' ) ) {
390
					$info[ $object_class ][ 'ID' ] = $value->ID();
391
				}
392
				if ( method_exists( $value, 'status' ) ) {
393
					$info[ $object_class ][ 'status' ] = $value->status();
394
				} else if ( method_exists( $value, 'status_ID' ) ) {
395
					$info[ $object_class ][ 'status' ] = $value->status_ID();
396
				}
397
				unset( $info[ $key ] );
398
			}
399
		}
400
		return (array)$info;
401
	}

modules/single_page_checkout/inc/EE_Checkout.class.php 1 location

@@ 1259-1271 (lines=13) @@
1256
	 */
1257
	public function _strip_objects( $info = array() ) {
1258
		foreach ( (array)$info as $key => $value ) {
1259
			if ( is_array( $value )) {
1260
				$info[ $key ] = $this->_strip_objects( $value );
1261
			} else if ( is_object( $value ) ) {
1262
				$object_class = get_class( $value );
1263
				$info[ $object_class ] = array();
1264
				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1265
				if ( method_exists( $value, 'status' ) ) {
1266
					$info[ $object_class ][ 'status' ] = $value->status();
1267
				} else if ( method_exists( $value, 'status_ID' ) ) {
1268
					$info[ $object_class ][ 'status' ] = $value->status_ID();
1269
				}
1270
				unset( $info[ $key ] );
1271
			}
1272
		}
1273
		return (array)$info;
1274
	}