Skip to content

Commit

Permalink
Merge pull request #285 from Prospress/issue_284
Browse files Browse the repository at this point in the history
Rename invalid method name in ActionScheduler_wcSystemStatus
  • Loading branch information
JPry authored Apr 15, 2019
2 parents 75e3fbc + 59036b9 commit 081cde6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/ActionScheduler_AdminView.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function init() {

public function system_status_report() {
$table = new ActionScheduler_wcSystemStatus( ActionScheduler::store() );
$table->print();
$table->render();
}

/**
Expand Down
20 changes: 19 additions & 1 deletion classes/ActionScheduler_wcSystemStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function __construct( $store ) {
*
* Helpful to identify issues, like a clogged queue.
*/
public function print() {
public function render() {
$action_counts = $this->store->action_counts();
$status_labels = $this->store->get_status_labels();
$oldest_and_newest = $this->get_oldest_and_newest( array_keys( $status_labels ) );
Expand Down Expand Up @@ -126,4 +126,22 @@ protected function get_template( $status_labels, $action_counts, $oldest_and_new
<?php
}

/**
* is triggered when invoking inaccessible methods in an object context.
*
* @param $name string
* @param $arguments array
*
* @return mixed
* @link https://php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods
*/
public function __call( $name, $arguments ) {
switch ( $name ) {
case 'print':
_deprecated_function( __CLASS__ . '::print()', '2.2.4', __CLASS__ . '::render()' );
return call_user_func_array( array( $this, 'render' ), $arguments );
}

return null;
}
}

0 comments on commit 081cde6

Please sign in to comment.