WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\PerformanceIndicators

Controller::sort() public WC 1.0

Sorts the list of stats. Sorted by custom arrangement.

{} It's a method of the class: Controller{}

Return

order. Nothing.

Usage

$Controller = new Controller();
$Controller->sort( $a, $b );
$a(object) (required)
First item.
$b(object) (required)
Second item.

Notes

Code of Controller::sort() WC 5.3.0

<?php
public function sort( $a, $b ) {
	/**
	 * Custom ordering for store performance indicators.
	 *
	 * @see https://github.com/woocommerce/woocommerce-admin/issues/1282
	 * @param array $indicators A list of ordered indicators.
	 */
	$stat_order = apply_filters(
		'woocommerce_rest_report_sort_performance_indicators',
		array(
			'revenue/total_sales',
			'revenue/net_revenue',
			'orders/orders_count',
			'orders/avg_order_value',
			'products/items_sold',
			'revenue/refunds',
			'coupons/orders_count',
			'coupons/amount',
			'taxes/total_tax',
			'taxes/order_tax',
			'taxes/shipping_tax',
			'revenue/shipping',
			'downloads/download_count',
		)
	);

	$a = array_search( $a->stat, $stat_order, true );
	$b = array_search( $b->stat, $stat_order, true );

	if ( false === $a && false === $b ) {
		return 0;
	} elseif ( false === $a ) {
		return 1;
	} elseif ( false === $b ) {
		return -1;
	} else {
		return $a - $b;
	}
}