Skip to content

Commit

Permalink
Merge branch 'trunk' into past-due-email-notify
Browse files Browse the repository at this point in the history
  • Loading branch information
crstauf committed Dec 9, 2024
2 parents 2f0a53a + 4326df7 commit bf9a15d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
14 changes: 7 additions & 7 deletions classes/ActionScheduler_ActionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ class ActionScheduler_ActionFactory {
/**
* Return stored actions for given params.
*
* @param string $status The action's status in the data store.
* @param string $hook The hook to trigger when this action runs.
* @param array $args Args to pass to callbacks when the hook is triggered.
* @param ActionScheduler_Schedule $schedule The action's schedule.
* @param string $group A group to put the action in.
* @param string $status The action's status in the data store.
* @param string $hook The hook to trigger when this action runs.
* @param array $args Args to pass to callbacks when the hook is triggered.
* @param ActionScheduler_Schedule|null $schedule The action's schedule.
* @param string $group A group to put the action in.
* phpcs:ignore Squiz.Commenting.FunctionComment.ExtraParamComment
* @param int $priority The action priority.
* @param int $priority The action priority.
*
* @return ActionScheduler_Action An instance of the stored action.
*/
public function get_stored_action( $status, $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
public function get_stored_action( $status, $hook, array $args = array(), ?ActionScheduler_Schedule $schedule = null, $group = '' ) {
// The 6th parameter ($priority) is not formally declared in the method signature to maintain compatibility with
// third-party subclasses created before this param was added.
$priority = func_num_args() >= 6 ? (int) func_get_arg( 5 ) : 10;
Expand Down
7 changes: 7 additions & 0 deletions classes/ActionScheduler_AdminView.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public function add_help_tabs() {
}

$as_version = ActionScheduler_Versions::instance()->latest_version();
$as_source = ActionScheduler_Versions::instance()->active_source();

$screen->add_help_tab(
array(
'id' => 'action_scheduler_about',
Expand All @@ -152,6 +154,11 @@ public function add_help_tabs() {
'<p>' .
__( 'Action Scheduler is a scalable, traceable job queue for background processing large sets of actions. Action Scheduler works by triggering an action hook to run at some time in the future. Scheduled actions can also be scheduled to run on a recurring schedule.', 'action-scheduler' ) .
'</p>' .
'<h3>' . esc_html__( 'Source', 'action-scheduler' ) . '</h3>' .
'<p>' .
esc_html__( 'Action Scheduler is currently being loaded from the following location. This can be useful when debugging, or if requested by the support team.', 'action-scheduler' ) .
'</p>' .
'<p><code>' . esc_html( $as_source ) . '</code></p>' .
'<h3>' . esc_html__( 'WP CLI', 'action-scheduler' ) . '</h3>' .
'<p>' .
sprintf(
Expand Down
4 changes: 4 additions & 0 deletions classes/ActionScheduler_Versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,8 @@ public static function initialize_latest_version() {
$self = self::instance();
call_user_func( $self->latest_version_callback() );
}

public function active_source() {
return trailingslashit( dirname( __DIR__ ) );
}
}
2 changes: 1 addition & 1 deletion deprecated/ActionScheduler_Schedule_Deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class ActionScheduler_Schedule_Deprecated implements ActionScheduler_Sc
*
* @return DateTime|null
*/
public function next( DateTime $after = null ) {
public function next( ?DateTime $after = null ) {
if ( empty( $after ) ) {
$return_value = $this->get_date();
$replacement_method = 'get_date()';
Expand Down
2 changes: 1 addition & 1 deletion lib/cron-expression/CronExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CronExpression
*
* @return CronExpression
*/
public static function factory($expression, CronExpression_FieldFactory $fieldFactory = null)
public static function factory($expression, ?CronExpression_FieldFactory $fieldFactory = null)
{
$mappings = array(
'@yearly' => '0 0 1 1 *',
Expand Down
2 changes: 1 addition & 1 deletion tests/ActionScheduler_UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function count(): int {
*
* @param null|\PHPUnit\Framework\TestResult $result Test result.
*/
public function run( PHPUnit\Framework\TestResult $result = null ): \PHPUnit\Framework\TestResult {
public function run( ?PHPUnit\Framework\TestResult $result = null ): \PHPUnit\Framework\TestResult {

if ( is_null( $result ) ) {
$result = $this->createResult();
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/ActionScheduler_Mocker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ActionScheduler_Mocker {
*
* @param null|ActionScheduler_Store $store Store instance.
*/
public static function get_queue_runner( ActionScheduler_Store $store = null ) {
public static function get_queue_runner( ?ActionScheduler_Store $store = null ) {

if ( ! $store ) {
$store = ActionScheduler_Store::instance();
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/deprecated/ActionScheduler_UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function count() {
*
* @param null|PHPUnit_Framework_TestResult $result Test result.
*/
public function run( PHPUnit_Framework_TestResult $result = null ) {
public function run( ?PHPUnit_Framework_TestResult $result = null ) {

if ( is_null( $result ) ) {
$result = $this->createResult();
Expand Down

0 comments on commit bf9a15d

Please sign in to comment.