← All changes
|
vendor/woocommerce/action-scheduler/classes/migration/Controller.php
+27
-8
1.2.0
→
1.7.7
View file →
| @@ -18,20 +18,41 @@ | ||
| 18 | 18 | * |
| 19 | 19 | * @codeCoverageIgnore |
| 20 | 20 | */ |
| 21 | 21 | class Controller { |
| 22 | + /** | |
| 23 | + * Instance. | |
| 24 | + * | |
| 25 | + * @var self | |
| 26 | + */ | |
| 22 | 27 | private static $instance; |
| 23 | 28 | |
| 24 | - /** @var Action_Scheduler\Migration\Scheduler */ | |
| 29 | + /** | |
| 30 | + * Scheduler instance. | |
| 31 | + * | |
| 32 | + * @var Action_Scheduler\Migration\Scheduler | |
| 33 | + */ | |
| 25 | 34 | private $migration_scheduler; |
| 26 | 35 | |
| 27 | - /** @var string */ | |
| 36 | + /** | |
| 37 | + * Class name of the store object. | |
| 38 | + * | |
| 39 | + * @var string | |
| 40 | + */ | |
| 28 | 41 | private $store_classname; |
| 29 | 42 | |
| 30 | - /** @var string */ | |
| 43 | + /** | |
| 44 | + * Class name of the logger object. | |
| 45 | + * | |
| 46 | + * @var string | |
| 47 | + */ | |
| 31 | 48 | private $logger_classname; |
| 32 | 49 | |
| 33 | - /** @var bool */ | |
| 50 | + /** | |
| 51 | + * Flag to indicate migrating custom store. | |
| 52 | + * | |
| 53 | + * @var bool | |
| 54 | + */ | |
| 34 | 55 | private $migrate_custom_store; |
| 35 | 56 | |
| 36 | 57 | /** |
| 37 | 58 | * Controller constructor. |
| @@ -141,9 +162,9 @@ | ||
| 141 | 162 | $config->set_progress_bar( new ProgressBar( '', 0 ) ); |
| 142 | 163 | } |
| 143 | 164 | } |
| 144 | 165 | |
| 145 | - return apply_filters( 'action_scheduler/migration_config', $config ); | |
| 166 | + return apply_filters( 'action_scheduler/migration_config', $config ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores | |
| 146 | 167 | } |
| 147 | 168 | |
| 148 | 169 | /** |
| 149 | 170 | * Hook dashboard migration notice. |
| @@ -170,9 +191,9 @@ | ||
| 170 | 191 | add_filter( 'action_scheduler_logger_class', array( $this, 'get_logger_class' ), 100, 1 ); |
| 171 | 192 | add_action( 'init', array( $this, 'maybe_hook_migration' ) ); |
| 172 | 193 | add_action( 'wp_loaded', array( $this, 'schedule_migration' ) ); |
| 173 | 194 | |
| 174 | - // Action Scheduler may be displayed as a Tools screen or WooCommerce > Status administration screen | |
| 195 | + // Action Scheduler may be displayed as a Tools screen or WooCommerce > Status administration screen. | |
| 175 | 196 | add_action( 'load-tools_page_action-scheduler', array( $this, 'hook_admin_notices' ), 10, 0 ); |
| 176 | 197 | add_action( 'load-woocommerce_page_wc-status', array( $this, 'hook_admin_notices' ), 10, 0 ); |
| 177 | 198 | } |
| 178 | 199 | |
| @@ -177,10 +198,8 @@ | ||
| 177 | 198 | } |
| 178 | 199 | |
| 179 | 200 | /** |
| 180 | 201 | * Possibly hook the migration scheduler action. |
| 181 | - * | |
| 182 | - * @author Jeremy Pry | |
| 183 | 202 | */ |
| 184 | 203 | public function maybe_hook_migration() { |
| 185 | 204 | if ( ! $this->allow_migration() || \ActionScheduler_DataController::is_migration_complete() ) { |
| 186 | 205 | return; |