Make src/Features/* internal except for Features.php, Onboarding.php and TransientNotices.php (https://github.com/woocommerce/woocommerce-admin/pull/8318)

* Move src/Features/* to src-internal/Admin/ except for Features.php, Features/Onboarding.php and TransientNotices.php
This commit is contained in:
Chi-Hsuan Huang 2022-02-21 17:47:28 +08:00 committed by GitHub
parent 9c49667dde
commit 56f7850d07
20 changed files with 33 additions and 24 deletions

View File

@ -4,7 +4,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Notes\Notes;

View File

@ -4,9 +4,8 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\API\Reports\Cache;
use Automattic\WooCommerce\Admin\Features\Features;

View File

@ -5,7 +5,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Loader;

View File

@ -3,7 +3,7 @@
* A Trait to help with managing the legacy coupon menu.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Features\Features;

View File

@ -5,7 +5,7 @@
* @package WooCommerce\Admin\Features
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
defined( 'ABSPATH' ) || exit;

View File

@ -4,7 +4,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Loader;

View File

@ -4,7 +4,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Marketing\InstalledExtensions;

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
defined( 'ABSPATH' ) || exit;

View File

@ -4,7 +4,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Features\Features;
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine;

View File

@ -4,10 +4,8 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Marketing\InstalledExtensions;
use Automattic\WooCommerce\Admin\Loader;
use Automattic\WooCommerce\Admin\PageController;
/**

View File

@ -4,7 +4,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use \Automattic\WooCommerce\Admin\Loader;
use \Automattic\Jetpack\Connection\Manager as Jetpack_Connection_Manager;

View File

@ -4,7 +4,7 @@
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
*/
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
/**
* Determines whether or not the Shipping Label Banner should be displayed

View File

@ -1,6 +1,6 @@
<?php
namespace Automattic\WooCommerce\Admin\Features;
namespace Automattic\WooCommerce\Internal\Admin;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks\WooCommercePayments;

View File

@ -7,7 +7,7 @@
namespace Automattic\WooCommerce\Admin\API;
use Automattic\WooCommerce\Admin\Features\Marketing as MarketingFeature;
use Automattic\WooCommerce\Internal\Admin\Marketing as MarketingFeature;
use Automattic\WooCommerce\Admin\PluginsHelper;
defined( 'ABSPATH' ) || exit;

View File

@ -142,7 +142,7 @@ class Options extends \WC_REST_Data_Controller {
* @return array
*/
public static function get_default_option_permissions() {
$is_woocommerce_admin = \Automattic\WooCommerce\Admin\Features\Homescreen::is_admin_user();
$is_woocommerce_admin = \Automattic\WooCommerce\Internal\Admin\Homescreen::is_admin_user();
$woocommerce_permissions = array(
'woocommerce_setup_jetpack_opted_in',
'woocommerce_stripe_settings',

View File

@ -402,6 +402,19 @@ class Features {
// new class => original class (this will be aliased).
'Automattic\WooCommerce\Internal\Admin\WCPayPromotion\Init' => 'Automattic\WooCommerce\Admin\Features\WcPayPromotion\Init',
'Automattic\WooCommerce\Internal\Admin\RemoteFreeExtensions\Init' => 'Automattic\WooCommerce\Admin\Features\RemoteFreeExtensions\Init',
'Automattic\WooCommerce\Internal\Admin\ActivityPanels' => 'Automattic\WooCommerce\Admin\Features\ActivityPanels',
'Automattic\WooCommerce\Internal\Admin\Analytics' => 'Automattic\WooCommerce\Admin\Features\Analytics',
'Automattic\WooCommerce\Internal\Admin\Coupons' => 'Automattic\WooCommerce\Admin\Features\Coupons',
'Automattic\WooCommerce\Internal\Admin\CouponsMovedTrait' => 'Automattic\WooCommerce\Admin\Features\CouponsMovedTrait',
'Automattic\WooCommerce\Internal\Admin\CustomerEffortScoreTracks' => 'Automattic\WooCommerce\Admin\Features\CustomerEffortScoreTracks',
'Automattic\WooCommerce\Internal\Admin\Homescreen' => 'Automattic\WooCommerce\Admin\Features\Homescreen',
'Automattic\WooCommerce\Internal\Admin\Marketing' => 'Automattic\WooCommerce\Admin\Features\Marketing',
'Automattic\WooCommerce\Internal\Admin\MobileAppBanner' => 'Automattic\WooCommerce\Admin\Features\MobileAppBanner',
'Automattic\WooCommerce\Internal\Admin\RemoteInboxNotifications' => 'Automattic\WooCommerce\Admin\Features\RemoteInboxNotifications',
'Automattic\WooCommerce\Internal\Admin\Settings' => 'Automattic\WooCommerce\Admin\Features\Settings',
'Automattic\WooCommerce\Internal\Admin\ShippingLabelBanner' => 'Automattic\WooCommerce\Admin\Features\ShippingLabelBanner',
'Automattic\WooCommerce\Internal\Admin\ShippingLabelBannerDisplayRules' => 'Automattic\WooCommerce\Admin\Features\ShippingLabelBannerDisplayRules',
'Automattic\WooCommerce\Internal\Admin\WcPayWelcomePage' => 'Automattic\WooCommerce\Admin\Features\WcPayWelcomePage',
);
foreach ( $aliases as $new_class => $orig_class ) {
class_alias( $new_class, $orig_class );

View File

@ -189,11 +189,11 @@ class CoreMenu {
}
$home_item = array();
if ( defined( '\Automattic\WooCommerce\Admin\Features\Homescreen::MENU_SLUG' ) ) {
if ( defined( '\Automattic\WooCommerce\Internal\Admin\Features\Homescreen::MENU_SLUG' ) ) {
$home_item = array(
'id' => 'woocommerce-home',
'title' => __( 'Home', 'woocommerce-admin' ),
'url' => \Automattic\WooCommerce\Admin\Features\Homescreen::MENU_SLUG,
'url' => \Automattic\WooCommerce\Internal\Admin\Homescreen::MENU_SLUG,
'order' => 0,
'matchExpression' => 'page=wc-admin((?!path=).)*$',
);

View File

@ -7,8 +7,7 @@
namespace Automattic\WooCommerce\Admin\Notes;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\Features\CouponsMovedTrait;
use Automattic\WooCommerce\Internal\Admin\CouponsMovedTrait;
use stdClass;
use WC_Data_Store;

View File

@ -5,7 +5,7 @@
* @package Automattic\WooCommerce\Admin\Features
*/
use \Automattic\WooCommerce\Admin\Features\CustomerEffortScoreTracks;
use Automattic\WooCommerce\Internal\Admin\CustomerEffortScoreTracks;
// CustomerEffortScoreTracks only works in wp-admin, so let's fake it.
define( 'WP_ADMIN', true );

View File

@ -5,7 +5,7 @@
* @package WooCommerce\Admin\Tests\ShippingLabelBannerDisplayRules
*/
use \Automattic\WooCommerce\Admin\Features\ShippingLabelBannerDisplayRules;
use Automattic\WooCommerce\Internal\Admin\ShippingLabelBannerDisplayRules;
/**
* Class WC_Tests_Shipping_Label_Banner_Display_Rules