Skip to content

Commit

Permalink
Merge pull request #1134 from crstauf/phpcs/ProgressBar.php
Browse files Browse the repository at this point in the history
PHPCS: `classes/WP_CLI/ProgressBar.php`
  • Loading branch information
barryhughes authored Oct 25, 2024
2 parents 9c12a73 + 91d46d7 commit f490160
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions classes/WP_CLI/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,39 @@
*/
class ProgressBar {

/** @var integer */
/**
* Current number of ticks.
*
* @var integer
*/
protected $total_ticks;

/** @var integer */
/**
* Total number of ticks.
*
* @var integer
*/
protected $count;

/** @var integer */
/**
* Progress bar update interval.
*
* @var integer
*/
protected $interval;

/** @var string */
/**
* Progress bar message.
*
* @var string
*/
protected $message;

/** @var \cli\progress\Bar */
/**
* Instance.
*
* @var \cli\progress\Bar
*/
protected $progress_bar;

/**
Expand All @@ -38,7 +58,7 @@ class ProgressBar {
* @param string $message Text to display before the progress bar.
* @param integer $count Total number of ticks to be performed.
* @param integer $interval Optional. The interval in milliseconds between updates. Default 100.
*
*
* @throws \Exception When this is not run within WP CLI.
*/
public function __construct( $message, $count, $interval = 100 ) {
Expand All @@ -64,7 +84,7 @@ public function tick() {
$this->progress_bar->tick();
$this->total_ticks++;

do_action( 'action_scheduler/progress_tick', $this->total_ticks );
do_action( 'action_scheduler/progress_tick', $this->total_ticks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

/**
Expand Down

0 comments on commit f490160

Please sign in to comment.