From 3d71ec92089cd16a5ff3029578fa467c331b454d Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Fri, 26 Oct 2018 14:02:53 +0200 Subject: [PATCH] Simplified compound expression to fix code for older PHP versions. --- .../data-stores/class-wc-admin-reports-data-store.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-data-store.php index c9e7f9c317b..048d39561a0 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-data-store.php @@ -389,7 +389,8 @@ class WC_Admin_Reports_Data_Store { $prev_start->setTimestamp( $prev_start_timestamp ); if ( $datetime_start ) { $start_datetime = new DateTime( $datetime_start ); - $intervals[ $key ]['date_start'] = ( $prev_start < $start_datetime ? $start_datetime : $prev_start )->format( 'Y-m-d H:i:s' ); + $date_start = $prev_start < $start_datetime ? $start_datetime : $prev_start; + $intervals[ $key ]['date_start'] = $date_start->format( 'Y-m-d H:i:s' ); } else { $intervals[ $key ]['date_start'] = $prev_start->format( 'Y-m-d H:i:s' ); } @@ -399,7 +400,8 @@ class WC_Admin_Reports_Data_Store { $next_end->setTimestamp( $next_end_timestamp ); if ( $datetime_end ) { $end_datetime = new DateTime( $datetime_end ); - $intervals[ $key ]['date_end'] = ( $next_end > $end_datetime ? $end_datetime : $next_end )->format( 'Y-m-d H:i:s' ); + $date_end = $next_end > $end_datetime ? $end_datetime : $next_end; + $intervals[ $key ]['date_end'] = $date_end->format( 'Y-m-d H:i:s' ); } else { $intervals[ $key ]['date_end'] = $next_end->format( 'Y-m-d H:i:s' ); }