diff --git a/plugins/woocommerce/includes/class-woocommerce.php b/plugins/woocommerce/includes/class-woocommerce.php index 67efc877654..ffa3cf06a7c 100644 --- a/plugins/woocommerce/includes/class-woocommerce.php +++ b/plugins/woocommerce/includes/class-woocommerce.php @@ -9,7 +9,7 @@ defined( 'ABSPATH' ) || exit; use Automattic\WooCommerce\Internal\AssignDefaultCategory; -use Automattic\WooCommerce\Internal\DataStores\Orders\FeatureController as OrdersTableFeatureController; +use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; use Automattic\WooCommerce\Internal\DownloadPermissionsAdjuster; use Automattic\WooCommerce\Internal\ProductAttributesLookup\DataRegenerator; use Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore; @@ -217,7 +217,7 @@ final class WooCommerce { wc_get_container()->get( DataRegenerator::class ); wc_get_container()->get( LookupDataStore::class ); wc_get_container()->get( RestockRefundedItemsAdjuster::class ); - wc_get_container()->get( OrdersTableFeatureController::class ); + wc_get_container()->get( CustomOrdersTableController::class ); } /** diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/FeatureController.php b/plugins/woocommerce/src/Internal/DataStores/Orders/CustomOrdersTableController.php similarity index 98% rename from plugins/woocommerce/src/Internal/DataStores/Orders/FeatureController.php rename to plugins/woocommerce/src/Internal/DataStores/Orders/CustomOrdersTableController.php index e953803de29..40bf64279df 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/FeatureController.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/CustomOrdersTableController.php @@ -1,6 +1,6 @@ get_data_store_instance( $default_data_store ); }, - 10, - 999 + 999, + 10 ); add_filter( @@ -71,8 +71,8 @@ class FeatureController { function( $tools ) { return $this->add_initiate_regeneration_entry_to_tools_array( $tools ); }, - 1, - 999 + 999, + 1 ); add_filter( @@ -80,8 +80,8 @@ class FeatureController { function( $sections ) { return $this->get_settings_sections( $sections ); }, - 1, - 999 + 999, + 1 ); add_filter( @@ -89,8 +89,8 @@ class FeatureController { function ( $settings, $section_id ) { return $this->get_settings( $settings, $section_id ); }, - 2, - 999 + 999, + 2 ); } @@ -247,7 +247,7 @@ class FeatureController { * @throws \Exception The table regeneration can't be started. */ private function check_can_do_table_regeneration() { - if ( ! $this->$this->is_feature_visible() ) { + if ( ! $this->is_feature_visible() ) { throw new \Exception( "Can't do custom orders table regeneration: the feature isn't enabled" ); } diff --git a/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php b/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php index 30aedb9b05a..0f0df800744 100644 --- a/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php +++ b/plugins/woocommerce/src/Internal/DataStores/Orders/DataSynchronizer.php @@ -11,7 +11,7 @@ defined( 'ABSPATH' ) || exit; * This class handles the data migration/synchronization for the custom orders table. Its responsibilites are: * * - Performing the initial table creation and filling (triggered by initiate_regeneration) - * - Syncrhonizing changes between the custom orders table and the posts table whenever changes in orders happen. + * - Synchronizing changes between the custom orders table and the posts table whenever changes in orders happen. */ class DataSynchronizer { @@ -77,7 +77,7 @@ class DataSynchronizer { * @return int Number of orders already processed, 0 if no regeneration is in progress. */ public function get_regeneration_processed_orders_count(): int { - return get_option( self::CUSTOM_ORDERS_TABLE_DATA_REGENERATION_DONE_COUNT, 0 ); + return (int)get_option( self::CUSTOM_ORDERS_TABLE_DATA_REGENERATION_DONE_COUNT, 0 ); } /** diff --git a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php index 98f17a418eb..929b87ea19f 100644 --- a/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php +++ b/plugins/woocommerce/src/Internal/DependencyManagement/ServiceProviders/OrdersDataStoreServiceProvider.php @@ -7,7 +7,7 @@ namespace Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders; use Automattic\WooCommerce\Internal\DependencyManagement\AbstractServiceProvider; use Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer; -use Automattic\WooCommerce\Internal\DataStores\Orders\FeatureController; +use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore; /** @@ -22,7 +22,7 @@ class OrdersDataStoreServiceProvider extends AbstractServiceProvider { */ protected $provides = array( DataSynchronizer::class, - FeatureController::class, + CustomOrdersTableController::class, OrdersTableDataStore::class, ); @@ -31,7 +31,7 @@ class OrdersDataStoreServiceProvider extends AbstractServiceProvider { */ public function register() { $this->share( DataSynchronizer::class )->addArgument( OrdersTableDataStore::class ); - $this->share( FeatureController::class )->addArguments( array( OrdersTableDataStore::class, DataSynchronizer::class ) ); + $this->share( CustomOrdersTableController::class )->addArguments( array( OrdersTableDataStore::class, DataSynchronizer::class ) ); $this->share( OrdersTableDataStore::class ); } }