Skip to content

Commit 6ccb229

Browse files
committed
Further fixes
1 parent 42aeb32 commit 6ccb229

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"wp-cli/entity-command": "^1.3 || ^2",
1919
"wp-cli/eval-command": "^2.0",
2020
"wp-cli/server-command": "^2.0",
21-
"wp-cli/wp-cli-tests": "dev-main"
21+
"wp-cli/wp-cli-tests": "dev-add/phpstan-enhancements"
2222
},
2323
"config": {
2424
"process-timeout": 7200,

src/Cron_Event_Command.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,7 @@ public function schedule( $args, $assoc_args ) {
167167

168168
$hook = $args[0];
169169

170-
/**
171-
* @var string $next_run
172-
*/
173-
$next_run = Utils\get_flag_value( $args, 1, 'now' );
174-
175-
/**
176-
* @var string|false $recurrence
177-
*/
170+
$next_run = Utils\get_flag_value( $args, 1, 'now' );
178171
$recurrence = Utils\get_flag_value( $args, 2, false );
179172

180173
if ( empty( $next_run ) ) {
@@ -464,8 +457,8 @@ protected static function get_cron_events( $is_due_now = false ) {
464457
* @return array|WP_Error An array of objects, or a WP_Error object is there are no events scheduled.
465458
*/
466459
protected static function get_selected_cron_events( $args, $assoc_args ) {
467-
$due_now = (bool) Utils\get_flag_value( $assoc_args, 'due-now' );
468-
$all = (bool) Utils\get_flag_value( $assoc_args, 'all' );
460+
$due_now = Utils\get_flag_value( $assoc_args, 'due-now' );
461+
$all = Utils\get_flag_value( $assoc_args, 'all' );
469462

470463
/**
471464
* @var string $exclude
@@ -571,6 +564,9 @@ private static function interval( $since ) {
571564
// x days, xx hours
572565
// so there's only two bits of calculation below:
573566

567+
$i = 0;
568+
$j = 0;
569+
574570
// step one: the first chunk
575571
for ( $i = 0, $j = count( $chunks ); $i < $j; $i++ ) {
576572
$seconds = $chunks[ $i ][0];

0 commit comments

Comments
 (0)