Skip to content

Commit

Permalink
fix php warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopolis committed Oct 2, 2016
1 parent ec94d3d commit 526f302
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions includes/class-edd-metrics-detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function revenue_callback( $data ) {
* @since 0.2.0
* @return array
*/
public function get_yearly_renewal_rate( $period = 365 ) {
public static function get_yearly_renewal_rate( $period = 365 ) {

// renewals last 12 mo / sales total from 24mo ago -> 12 mo ago
$now = strtotime('now');
Expand Down Expand Up @@ -151,7 +151,7 @@ public function get_yearly_renewal_rate( $period = 365 ) {
* @since 0.2.0
* @return array
*/
public function get_single_product_detail( $data ) {
public static function get_single_product_detail( $data ) {

$dates = self::get_compare_dates();

Expand Down Expand Up @@ -199,7 +199,7 @@ public function get_single_product_detail( $data ) {
* @since 0.2.0
* @return array()
*/
public function get_edd_gateway_reports() {
public static function get_edd_gateway_reports() {

$reports_data = array();
$gateways = edd_get_enabled_payment_gateways();
Expand Down
34 changes: 17 additions & 17 deletions includes/class-edd-metrics-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private function hooks() {
* @since 0.2.0
* @return void
*/
public static function metrics_batch_1( $start, $end ) {
public static function metrics_batch_1() {
self::$endstr = $_POST['end'];
self::$startstr = $_POST['start'];
self::$end = strtotime( self::$endstr );
Expand Down Expand Up @@ -122,7 +122,7 @@ public static function metrics_batch_1( $start, $end ) {
* @since 0.2.0
* @return void
*/
public static function metrics_batch_2( $start, $end ) {
public static function metrics_batch_2() {
self::$endstr = $_POST['end'];
self::$startstr = $_POST['start'];
self::$end = strtotime( self::$endstr );
Expand Down Expand Up @@ -200,7 +200,7 @@ public static function get_earnings() {
* @since 0.2.0
* @return array()
*/
public function get_avg_percust( $earnings = null, $previous_earnings = null ) {
public static function get_avg_percust( $earnings = null, $previous_earnings = null ) {

$dates = self::get_compare_dates();

Expand Down Expand Up @@ -266,7 +266,7 @@ public static function get_edd_customers_by_date( $start, $end ) {
* @since 0.2.0
* @return array()
*/
public function get_avg_monthly() {
public static function get_avg_monthly() {
$avg = edd_estimated_monthly_stats();
return array(
'earnings' => edd_currency_filter( edd_format_amount( $avg['earnings'] ) ),
Expand All @@ -281,7 +281,7 @@ public function get_avg_monthly() {
* @since 0.2.0
* @return array()
*/
public function get_avg_yearly( $earnings = null, $previous_earnings = null, $num_days = null ) {
public static function get_avg_yearly( $earnings = null, $previous_earnings = null, $num_days = null ) {

// Fix division by 0 errors
if( !$earnings && !$previous_earnings ) {
Expand Down Expand Up @@ -355,7 +355,7 @@ public static function get_compare_dates() {
* @since 0.2.0
* @return array()
*/
public function subtract_days( $start = null, $end = null, $num_days = null ) {
public static function subtract_days( $start = null, $end = null, $num_days = null ) {

// Switch to datetime format, subtract time, then back to string
$startdate = date_create( $start );
Expand All @@ -379,7 +379,7 @@ public function subtract_days( $start = null, $end = null, $num_days = null ) {
* @since 0.2.0
* @return integer
*/
public function percent_change($new_val, $old_val) {
public static function percent_change($new_val, $old_val) {

if( empty( $old_val ) )
return 0;
Expand All @@ -398,7 +398,7 @@ public function percent_change($new_val, $old_val) {
* @since 0.2.0
* @return integer
*/
public function get_percentage( $current_value = null, $prev_value = null ) {
public static function get_percentage( $current_value = null, $prev_value = null ) {

// avoid division by 0 errors
if( empty( $prev_value ) && $current_value > 0 ) {
Expand Down Expand Up @@ -431,7 +431,7 @@ public function get_percentage( $current_value = null, $prev_value = null ) {
* @since 0.2.0
* @return string
*/
public function get_arrow_classes( $current = null, $previous = null ) {
public static function get_arrow_classes( $current = null, $previous = null ) {

// output classes for arrows and colors
if( intval( $previous ) > intval( $current ) ) {
Expand Down Expand Up @@ -522,7 +522,7 @@ public static function do_sidebar() {
* @since 0.2.0
* @return array( 'count' => $count, 'earnings' => $earnings )
*/
public function get_renewals_by_date( $start = null, $end = null ) {
public static function get_renewals_by_date( $start = null, $end = null ) {

// see reports.php in EDD SL plugin
// edd_sl_get_renewals_by_date( $day = null, $month = null, $year = null, $hour = null )
Expand Down Expand Up @@ -599,7 +599,7 @@ public static function compare_renewals( $current_renewals = null ) {
* @since 0.2.0
* @return
*/
public function get_discounts( $start = string, $end = string ) {
public static function get_discounts( $start = string, $end = string ) {

$args = array(
'post_type' => 'edd_payment',
Expand Down Expand Up @@ -651,7 +651,7 @@ public function get_discounts( $start = string, $end = string ) {
* @since 0.2.0
* @return array()
*/
public function compare_discounts( $current_discounts_amount = null ) {
public static function compare_discounts( $current_discounts_amount = null ) {

$dates = self::get_compare_dates();

Expand All @@ -670,7 +670,7 @@ public function compare_discounts( $current_discounts_amount = null ) {
* @since 0.2.0
* @return array( 'count' => $count, 'earnings' => $earnings )
*/
public function refund_query( $start, $end ) {
public static function refund_query( $start, $end ) {

$args = array(
'post_type' => 'edd_payment',
Expand Down Expand Up @@ -752,7 +752,7 @@ public static function compare_refunds( $current_refunds = null ) {
* @since 0.2.0
* @return array()
*/
public function subscriptions_db( $start = string, $end = string ) {
public static function subscriptions_db( $start = string, $end = string ) {

if( !class_exists('EDD_Subscriptions_DB') ) {
return 0;
Expand Down Expand Up @@ -785,7 +785,7 @@ public function subscriptions_db( $start = string, $end = string ) {
* @since 0.2.0
* @return array()
*/
public function get_subscriptions( $start = string, $end = string ) {
public static function get_subscriptions( $start = string, $end = string ) {

$total = self::subscriptions_db( $start, $end );

Expand All @@ -799,7 +799,7 @@ public function get_subscriptions( $start = string, $end = string ) {
* @since 0.2.0
* @return array()
*/
public function compare_subscriptions( $current_subscriptions = null ) {
public static function compare_subscriptions( $current_subscriptions = null ) {

$dates = self::get_compare_dates();

Expand All @@ -818,7 +818,7 @@ public function compare_subscriptions( $current_subscriptions = null ) {
* @since 0.2.0
* @return array
*/
public function get_chart_data( $dates = null, $monthly = false ) {
public static function get_chart_data( $dates = null, $monthly = false ) {

$EDD_Stats = new EDD_Payment_Stats();

Expand Down

0 comments on commit 526f302

Please sign in to comment.