Skip to content

Commit

Permalink
eliminate code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
crstauf committed Oct 4, 2024
1 parent 57da8e6 commit ad338b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions classes/migration/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
*/
class Scheduler {
/** Migration action hook. */
const HOOK = 'action_scheduler/migration_hook';
const HOOK = 'action_scheduler/migration_hook';

/** Migration action group. */
const GROUP = 'action-scheduler-migration';
const GROUP = 'action-scheduler-migration';

/**
* Set up the callback for the scheduled job.
Expand All @@ -40,7 +40,7 @@ public function run_migration() {
$migration_runner = $this->get_migration_runner();
$count = $migration_runner->run( $this->get_batch_size() );

if ( $count === 0 ) {
if ( 0 === $count ) {
$this->mark_complete();
} else {
$this->schedule_migration( time() + $this->get_schedule_interval() );
Expand All @@ -54,7 +54,7 @@ public function mark_complete() {
$this->unschedule_migration();

\ActionScheduler_DataController::mark_migration_complete();
do_action( 'action_scheduler/migration_complete' );
do_action( 'action_scheduler/migration_complete' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

/**
Expand Down Expand Up @@ -102,7 +102,7 @@ public function unschedule_migration() {
* @return int Seconds between migration runs. Defaults to 0 seconds to allow chaining migration via Async Runners.
*/
private function get_schedule_interval() {
return (int) apply_filters( 'action_scheduler/migration_interval', 0 );
return (int) apply_filters( 'action_scheduler/migration_interval', 0 ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

/**
Expand All @@ -111,7 +111,7 @@ private function get_schedule_interval() {
* @return int Number of actions to migrate in each batch. Defaults to 250.
*/
private function get_batch_size() {
return (int) apply_filters( 'action_scheduler/migration_batch_size', 250 );
return (int) apply_filters( 'action_scheduler/migration_batch_size', 250 ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

/**
Expand Down

0 comments on commit ad338b9

Please sign in to comment.