WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats

Controller::set_default_report_data() public WC 1.0

Set the default results to 0 if API returns an empty array

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

No Hooks.

Return

Object.

Usage

$Controller = new Controller();
$Controller->set_default_report_data( $results );
$results(Mixed) (required)
Report data.

Code of Controller::set_default_report_data() WC 6.1.1

public function set_default_report_data( $results ) {
	if ( empty( $results ) ) {
		$results                       = new \stdClass();
		$results->total                = 0;
		$results->totals               = new \stdClass();
		$results->totals->tax_codes    = 0;
		$results->totals->total_tax    = 0;
		$results->totals->order_tax    = 0;
		$results->totals->shipping_tax = 0;
		$results->totals->orders       = 0;
		$results->intervals            = array();
		$results->pages                = 1;
		$results->page_no              = 1;
	}
	return $results;
}