Skip to content

Commit 7e58c59

Browse files
committed
Solve with comment instead
1 parent ee5b7ff commit 7e58c59

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Cron_Event_Command.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,20 @@ public function schedule( $args, $assoc_args ) {
185185
WP_CLI::error( sprintf( "'%s' is not a valid datetime.", $next_run ) );
186186
}
187187

188-
$cron_args = $assoc_args;
189-
ksort( $cron_args );
190-
$cron_args = array_values( $cron_args );
191-
192188
if ( ! empty( $recurrence ) ) {
193189
$schedules = wp_get_schedules();
194190

195191
if ( ! isset( $schedules[ $recurrence ] ) ) {
196192
WP_CLI::error( sprintf( "'%s' is not a valid schedule name for recurrence.", $recurrence ) );
197193
}
198194

199-
$event = wp_schedule_event( $timestamp, $recurrence, $hook, $cron_args );
195+
// WordPress expects a list bug we knowingly pass an associative array.
196+
// @phpstan-ignore argument.type
197+
$event = wp_schedule_event( $timestamp, $recurrence, $hook, $assoc_args );
200198
} else {
201-
$event = wp_schedule_single_event( $timestamp, $hook, $cron_args );
199+
// Ditto.
200+
// @phpstan-ignore argument.type
201+
$event = wp_schedule_single_event( $timestamp, $hook, $assoc_args );
202202
}
203203

204204
if ( false !== $event ) {

0 commit comments

Comments
 (0)