← All changes
|
vendor/woocommerce/action-scheduler/classes/WP_CLI/ProgressBar.php
+27
-7
1.5.4
→
trunk
View file →
| @@ -16,21 +16,41 @@ | ||
| 16 | 16 | * @codeCoverageIgnore |
| 17 | 17 | */ |
| 18 | 18 | class ProgressBar { |
| 19 | 19 | |
| 20 | - /** @var integer */ | |
| 20 | + /** | |
| 21 | + * Current number of ticks. | |
| 22 | + * | |
| 23 | + * @var integer | |
| 24 | + */ | |
| 21 | 25 | protected $total_ticks; |
| 22 | 26 | |
| 23 | - /** @var integer */ | |
| 27 | + /** | |
| 28 | + * Total number of ticks. | |
| 29 | + * | |
| 30 | + * @var integer | |
| 31 | + */ | |
| 24 | 32 | protected $count; |
| 25 | 33 | |
| 26 | - /** @var integer */ | |
| 34 | + /** | |
| 35 | + * Progress bar update interval. | |
| 36 | + * | |
| 37 | + * @var integer | |
| 38 | + */ | |
| 27 | 39 | protected $interval; |
| 28 | 40 | |
| 29 | - /** @var string */ | |
| 41 | + /** | |
| 42 | + * Progress bar message. | |
| 43 | + * | |
| 44 | + * @var string | |
| 45 | + */ | |
| 30 | 46 | protected $message; |
| 31 | 47 | |
| 32 | - /** @var \cli\progress\Bar */ | |
| 48 | + /** | |
| 49 | + * Instance. | |
| 50 | + * | |
| 51 | + * @var \cli\progress\Bar | |
| 52 | + */ | |
| 33 | 53 | protected $progress_bar; |
| 34 | 54 | |
| 35 | 55 | /** |
| 36 | 56 | * ProgressBar constructor. |
| @@ -37,9 +57,9 @@ | ||
| 37 | 57 | * |
| 38 | 58 | * @param string $message Text to display before the progress bar. |
| 39 | 59 | * @param integer $count Total number of ticks to be performed. |
| 40 | 60 | * @param integer $interval Optional. The interval in milliseconds between updates. Default 100. |
| 41 | - * | |
| 61 | + * | |
| 42 | 62 | * @throws \Exception When this is not run within WP CLI. |
| 43 | 63 | */ |
| 44 | 64 | public function __construct( $message, $count, $interval = 100 ) { |
| 45 | 65 | if ( ! ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
| @@ -63,9 +83,9 @@ | ||
| 63 | 83 | |
| 64 | 84 | $this->progress_bar->tick(); |
| 65 | 85 | $this->total_ticks++; |
| 66 | 86 | |
| 67 | - do_action( 'action_scheduler/progress_tick', $this->total_ticks ); | |
| 87 | + do_action( 'action_scheduler/progress_tick', $this->total_ticks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores | |
| 68 | 88 | } |
| 69 | 89 | |
| 70 | 90 | /** |
| 71 | 91 | * Get the progress bar tick count. |