Skip to content

Commit bc7e4bd

Browse files
authored
Merge pull request #100 from wp-cli/fix/wpcs-3.0-issues
2 parents 3de548b + 0138185 commit bc7e4bd

File tree

5 files changed

+4
-16
lines changed

5 files changed

+4
-16
lines changed

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": "^3.1"
21+
"wp-cli/wp-cli-tests": "^4"
2222
},
2323
"config": {
2424
"process-timeout": 7200,

cron-command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
return;
55
}
66

7-
$wpcli_cron_autoloader = dirname( __FILE__ ) . '/vendor/autoload.php';
7+
$wpcli_cron_autoloader = __DIR__ . '/vendor/autoload.php';
88
if ( file_exists( $wpcli_cron_autoloader ) ) {
99
require_once $wpcli_cron_autoloader;
1010
}

src/Cron_Command.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function test() {
5252
} else {
5353
WP_CLI::error( sprintf( 'WP-Cron spawn returned HTTP status code: %1$s %2$s', $code, $message ) );
5454
}
55-
5655
}
5756

5857
/**
@@ -89,7 +88,5 @@ protected static function get_cron_spawn() {
8988
$result = wp_remote_post( $cron_request['url'], $cron_request['args'] );
9089

9190
return $result;
92-
9391
}
94-
9592
}

src/Cron_Event_Command.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public function list_( $args, $assoc_args ) {
120120
} else {
121121
$formatter->display_items( $events );
122122
}
123-
124123
}
125124

126125
/**
@@ -196,7 +195,6 @@ public function schedule( $args, $assoc_args ) {
196195
} else {
197196
WP_CLI::error( 'Event not scheduled.' );
198197
}
199-
200198
}
201199

202200
/**
@@ -285,7 +283,7 @@ function ( $event ) use ( $args, $exclude ) {
285283
$start = microtime( true );
286284
$result = self::run_event( $event );
287285
$total = round( microtime( true ) - $start, 3 );
288-
$executed++;
286+
++$executed;
289287
WP_CLI::log( sprintf( "Executed the cron event '%s' in %ss.", $event->hook, $total ) );
290288
}
291289

@@ -337,7 +335,6 @@ public function unschedule( $args, $assoc_args ) {
337335
)
338336
);
339337
}
340-
341338
}
342339

343340
/**
@@ -364,7 +361,6 @@ protected static function run_event( stdClass $event ) {
364361
do_action_ref_array( $event->hook, $event->args );
365362

366363
return true;
367-
368364
}
369365

370366
/**
@@ -395,7 +391,7 @@ public function delete( $args, $assoc_args ) {
395391
if ( $event->hook === $hook ) {
396392
$result = self::delete_event( $event );
397393
if ( $result ) {
398-
$deleted++;
394+
++$deleted;
399395
} else {
400396
WP_CLI::warning( sprintf( "Failed to the delete the cron event '%s'.", $hook ) );
401397
}
@@ -408,7 +404,6 @@ public function delete( $args, $assoc_args ) {
408404
} else {
409405
WP_CLI::error( sprintf( "Invalid cron event '%s'.", $hook ) );
410406
}
411-
412407
}
413408

414409
/**
@@ -495,7 +490,6 @@ protected static function get_cron_events( $is_due_now = false ) {
495490
$events = array_map( 'Cron_Event_Command::format_event', $events );
496491

497492
return $events;
498-
499493
}
500494

501495
/**
@@ -562,5 +556,4 @@ private static function interval( $since ) {
562556
private function get_formatter( &$assoc_args ) {
563557
return new \WP_CLI\Formatter( $assoc_args, $this->fields, 'event' );
564558
}
565-
566559
}

src/Cron_Schedule_Command.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public function list_( $args, $assoc_args ) {
8484
} else {
8585
$formatter->display_items( $schedules );
8686
}
87-
8887
}
8988

9089
/**
@@ -124,5 +123,4 @@ protected static function sort( array $a, array $b ) {
124123
private function get_formatter( &$assoc_args ) {
125124
return new \WP_CLI\Formatter( $assoc_args, $this->fields, 'schedule' );
126125
}
127-
128126
}

0 commit comments

Comments
 (0)