Code Duplication    Length = 13-14 lines in 2 locations

core/helpers/EEH_Debug_Tools.helper.php 1 location

@@ 357-370 (lines=14) @@
354
        foreach ($info as $key => $value) {
355
            if (is_array($value)) {
356
                $info[$key] = self::strip_objects($value);
357
            } else if (is_object($value)) {
358
                $object_class = get_class($value);
359
                $info[$object_class] = array();
360
                $info[$object_class]['ID'] = method_exists($value, 'ID') ? $value->ID() : spl_object_hash($value);
361
                if (method_exists($value, 'ID')) {
362
                    $info[$object_class]['ID'] = $value->ID();
363
                }
364
                if (method_exists($value, 'status')) {
365
                    $info[$object_class]['status'] = $value->status();
366
                } else if (method_exists($value, 'status_ID')) {
367
                    $info[$object_class]['status'] = $value->status_ID();
368
                }
369
                unset($info[$key]);
370
            }
371
        }
372
        return (array)$info;
373
    }

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

@@ 1294-1306 (lines=13) @@
1291
	 */
1292
	public function _strip_objects( $info = array() ) {
1293
		foreach ( (array)$info as $key => $value ) {
1294
			if ( is_array( $value )) {
1295
				$info[ $key ] = $this->_strip_objects( $value );
1296
			} else if ( is_object( $value ) ) {
1297
				$object_class = get_class( $value );
1298
				$info[ $object_class ] = array();
1299
				$info[ $object_class ][ 'ID' ] = method_exists( $value, 'ID' ) ? $value->ID() : 0;
1300
				if ( method_exists( $value, 'status' ) ) {
1301
					$info[ $object_class ][ 'status' ] = $value->status();
1302
				} else if ( method_exists( $value, 'status_ID' ) ) {
1303
					$info[ $object_class ][ 'status' ] = $value->status_ID();
1304
				}
1305
				unset( $info[ $key ] );
1306
			}
1307
		}
1308
		return (array)$info;
1309
	}