Skip to content

Commit b2f889a

Browse files
authored
Merge pull request #1220 from woocommerce/fix/php84-more-nullables
Make some other nullable parameters explicitly nullable
2 parents ac7991d + 4436733 commit b2f889a

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-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;

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)