Skip to content

Commit eb438cb

Browse files
committed
Merge branch 'trunk' into fix-forum-17945942
2 parents c51b749 + 4326df7 commit eb438cb

8 files changed

+23
-12
lines changed

classes/ActionScheduler_ActionFactory.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ class ActionScheduler_ActionFactory {
88
/**
99
* Return stored actions for given params.
1010
*
11-
* @param string $status The action's status in the data store.
12-
* @param string $hook The hook to trigger when this action runs.
13-
* @param array $args Args to pass to callbacks when the hook is triggered.
14-
* @param ActionScheduler_Schedule $schedule The action's schedule.
15-
* @param string $group A group to put the action in.
11+
* @param string $status The action's status in the data store.
12+
* @param string $hook The hook to trigger when this action runs.
13+
* @param array $args Args to pass to callbacks when the hook is triggered.
14+
* @param ActionScheduler_Schedule|null $schedule The action's schedule.
15+
* @param string $group A group to put the action in.
1616
* phpcs:ignore Squiz.Commenting.FunctionComment.ExtraParamComment
17-
* @param int $priority The action priority.
17+
* @param int $priority The action priority.
1818
*
1919
* @return ActionScheduler_Action An instance of the stored action.
2020
*/
21-
public function get_stored_action( $status, $hook, array $args = array(), ActionScheduler_Schedule $schedule = null, $group = '' ) {
21+
public function get_stored_action( $status, $hook, array $args = array(), ?ActionScheduler_Schedule $schedule = null, $group = '' ) {
2222
// The 6th parameter ($priority) is not formally declared in the method signature to maintain compatibility with
2323
// third-party subclasses created before this param was added.
2424
$priority = func_num_args() >= 6 ? (int) func_get_arg( 5 ) : 10;

classes/ActionScheduler_AdminView.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ public function add_help_tabs() {
251251
}
252252

253253
$as_version = ActionScheduler_Versions::instance()->latest_version();
254+
$as_source = ActionScheduler_Versions::instance()->active_source();
255+
254256
$screen->add_help_tab(
255257
array(
256258
'id' => 'action_scheduler_about',
@@ -261,6 +263,11 @@ public function add_help_tabs() {
261263
'<p>' .
262264
__( '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' ) .
263265
'</p>' .
266+
'<h3>' . esc_html__( 'Source', 'action-scheduler' ) . '</h3>' .
267+
'<p>' .
268+
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' ) .
269+
'</p>' .
270+
'<p><code>' . esc_html( $as_source ) . '</code></p>' .
264271
'<h3>' . esc_html__( 'WP CLI', 'action-scheduler' ) . '</h3>' .
265272
'<p>' .
266273
sprintf(

classes/ActionScheduler_Versions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,8 @@ public static function initialize_latest_version() {
8686
$self = self::instance();
8787
call_user_func( $self->latest_version_callback() );
8888
}
89+
90+
public function active_source() {
91+
return trailingslashit( dirname( __DIR__ ) );
92+
}
8993
}

deprecated/ActionScheduler_Schedule_Deprecated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ abstract class ActionScheduler_Schedule_Deprecated implements ActionScheduler_Sc
1313
*
1414
* @return DateTime|null
1515
*/
16-
public function next( DateTime $after = null ) {
16+
public function next( ?DateTime $after = null ) {
1717
if ( empty( $after ) ) {
1818
$return_value = $this->get_date();
1919
$replacement_method = 'get_date()';

lib/cron-expression/CronExpression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CronExpression
5454
*
5555
* @return CronExpression
5656
*/
57-
public static function factory($expression, CronExpression_FieldFactory $fieldFactory = null)
57+
public static function factory($expression, ?CronExpression_FieldFactory $fieldFactory = null)
5858
{
5959
$mappings = array(
6060
'@yearly' => '0 0 1 1 *',

tests/ActionScheduler_UnitTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function count(): int {
4444
*
4545
* @param null|\PHPUnit\Framework\TestResult $result Test result.
4646
*/
47-
public function run( PHPUnit\Framework\TestResult $result = null ): \PHPUnit\Framework\TestResult {
47+
public function run( ?PHPUnit\Framework\TestResult $result = null ): \PHPUnit\Framework\TestResult {
4848

4949
if ( is_null( $result ) ) {
5050
$result = $this->createResult();

tests/phpunit/ActionScheduler_Mocker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ActionScheduler_Mocker {
1212
*
1313
* @param null|ActionScheduler_Store $store Store instance.
1414
*/
15-
public static function get_queue_runner( ActionScheduler_Store $store = null ) {
15+
public static function get_queue_runner( ?ActionScheduler_Store $store = null ) {
1616

1717
if ( ! $store ) {
1818
$store = ActionScheduler_Store::instance();

tests/phpunit/deprecated/ActionScheduler_UnitTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function count() {
4545
*
4646
* @param null|PHPUnit_Framework_TestResult $result Test result.
4747
*/
48-
public function run( PHPUnit_Framework_TestResult $result = null ) {
48+
public function run( ?PHPUnit_Framework_TestResult $result = null ) {
4949

5050
if ( is_null( $result ) ) {
5151
$result = $this->createResult();

0 commit comments

Comments
 (0)