mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Use a helper to map the settings tab.
This commit is contained in:
parent
480dd8d8aa
commit
619c3b1467
1 changed files with 10 additions and 6 deletions
|
@ -12,6 +12,7 @@ namespace WooCommerce\PayPalCommerce\Compat;
|
||||||
use WooCommerce\PayPalCommerce\Compat\Assets\CompatAssets;
|
use WooCommerce\PayPalCommerce\Compat\Assets\CompatAssets;
|
||||||
use WooCommerce\PayPalCommerce\Compat\Settings\SettingsMap;
|
use WooCommerce\PayPalCommerce\Compat\Settings\SettingsMap;
|
||||||
use WooCommerce\PayPalCommerce\Compat\Settings\SettingsMapHelper;
|
use WooCommerce\PayPalCommerce\Compat\Settings\SettingsMapHelper;
|
||||||
|
use WooCommerce\PayPalCommerce\Compat\Settings\SettingsTabMapHelper;
|
||||||
use WooCommerce\PayPalCommerce\Compat\Settings\StylingSettingsMapHelper;
|
use WooCommerce\PayPalCommerce\Compat\Settings\StylingSettingsMapHelper;
|
||||||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
|
@ -133,6 +134,9 @@ return array(
|
||||||
$styling_settings_map_helper = $container->get( 'compat.settings.styling_map_helper' );
|
$styling_settings_map_helper = $container->get( 'compat.settings.styling_map_helper' );
|
||||||
assert( $styling_settings_map_helper instanceof StylingSettingsMapHelper );
|
assert( $styling_settings_map_helper instanceof StylingSettingsMapHelper );
|
||||||
|
|
||||||
|
$settings_tab_map_helper = $container->get( 'compat.settings.settings_tab_map_helper' );
|
||||||
|
assert( $settings_tab_map_helper instanceof SettingsTabMapHelper );
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
new SettingsMap(
|
new SettingsMap(
|
||||||
$container->get( 'settings.data.general' ),
|
$container->get( 'settings.data.general' ),
|
||||||
|
@ -160,11 +164,7 @@ return array(
|
||||||
),
|
),
|
||||||
new SettingsMap(
|
new SettingsMap(
|
||||||
$container->get( 'settings.data.settings' ),
|
$container->get( 'settings.data.settings' ),
|
||||||
array(
|
$settings_tab_map_helper->map()
|
||||||
'disable_cards' => 'disabled_cards',
|
|
||||||
'brand_name' => 'brand_name',
|
|
||||||
'soft_descriptor' => 'soft_descriptor',
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
new SettingsMap(
|
new SettingsMap(
|
||||||
$container->get( 'settings.data.styling' ),
|
$container->get( 'settings.data.styling' ),
|
||||||
|
@ -185,10 +185,14 @@ return array(
|
||||||
'compat.settings.settings_map_helper' => static function( ContainerInterface $container ) : SettingsMapHelper {
|
'compat.settings.settings_map_helper' => static function( ContainerInterface $container ) : SettingsMapHelper {
|
||||||
return new SettingsMapHelper(
|
return new SettingsMapHelper(
|
||||||
$container->get( 'compat.setting.new-to-old-map' ),
|
$container->get( 'compat.setting.new-to-old-map' ),
|
||||||
$container->get( 'compat.settings.styling_map_helper' )
|
$container->get( 'compat.settings.styling_map_helper' ),
|
||||||
|
$container->get( 'compat.settings.settings_tab_map_helper' )
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
'compat.settings.styling_map_helper' => static function() : StylingSettingsMapHelper {
|
'compat.settings.styling_map_helper' => static function() : StylingSettingsMapHelper {
|
||||||
return new StylingSettingsMapHelper();
|
return new StylingSettingsMapHelper();
|
||||||
},
|
},
|
||||||
|
'compat.settings.settings_tab_map_helper' => static function() : SettingsTabMapHelper {
|
||||||
|
return new SettingsTabMapHelper();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue