Move variable definitions in class

This commit is contained in:
Adrien Foulon 2019-03-14 16:44:26 +01:00 committed by GitHub
parent 005d7491cf
commit 7d77241ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 21 deletions

View File

@ -17,17 +17,14 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Admin_Report {
/**
* Init the static hooks of the class.
* @var array List of transients name that have been updated and need persisting.
*/
protected static function add_update_transients_hook() {
static $done = false;
if ( $done ) {
return;
}
$done = true;
add_action( 'shutdown', array( 'WC_Admin_Report', 'maybe_update_transients' ) );
}
protected static $transients_to_update = array();
/**
* @var array The list of transients.
*/
protected static $cached_results = array();
/**
* The chart interval.
@ -357,7 +354,19 @@ class WC_Admin_Report {
return $result;
}
/**
* Init the static hooks of the class.
*/
protected static function add_update_transients_hook() {
static $done = false;
if ( $done ) {
return;
}
$done = true;
add_action( 'shutdown', array( 'WC_Admin_Report', 'maybe_update_transients' ) );
}
/**
* Enables big mysql selects for reports, just once for this session
*/
@ -412,16 +421,6 @@ class WC_Admin_Report {
self::$cached_results[ $class ][ $query_hash ] = $data;
}
/**
* @var array List of transients name that have been updated and need persisting.
*/
protected static $transients_to_update = array();
/**
* @var array The list of transients.
*/
protected static $cached_results = array();
/**
* Function to update the modified transients at the end of the request.
*/