♻️ Apply more suitable DI service name

This commit is contained in:
Philipp Stracker 2025-03-14 12:17:15 +01:00
parent cad5378089
commit d4857102fe
No known key found for this signature in database
9 changed files with 25 additions and 25 deletions

View file

@ -35,7 +35,7 @@ return array(
$container->get( 'axo.gateway' ),
fn(): SmartButtonInterface => $container->get( 'button.smart-button' ),
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.configuration.dcc' ),
$container->get( 'wcgateway.configuration.card-configuration' ),
$container->get( 'settings.environment' ),
$container->get( 'wcgateway.url' ),
$container->get( 'axo.payment_method_selected_map' ),

View file

@ -188,7 +188,7 @@ class AxoBlockModule implements ServiceModule, ExtendingModule, ExecutableModule
return;
}
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
if ( ! $dcc_configuration->use_fastlane() ) {
return;
}

View file

@ -41,7 +41,7 @@ return array(
'axo.helpers.compatibility-checker' => static function ( ContainerInterface $container ) : CompatibilityChecker {
return new CompatibilityChecker(
$container->get( 'axo.fastlane-incompatible-plugin-names' ),
$container->get( 'wcgateway.configuration.dcc' )
$container->get( 'wcgateway.configuration.card-configuration' )
);
},
@ -83,7 +83,7 @@ return array(
return new AxoGateway(
$container->get( 'wcgateway.settings.render' ),
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.configuration.dcc' ),
$container->get( 'wcgateway.configuration.card-configuration' ),
$container->get( 'wcgateway.url' ),
$container->get( 'session.handler' ),
$container->get( 'wcgateway.order-processor' ),
@ -228,7 +228,7 @@ return array(
},
'axo.smart-button-location-notice' => static function ( ContainerInterface $container ) : string {
$dcc_configuration = $container->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $container->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
if ( $dcc_configuration->use_fastlane() ) {

View file

@ -98,7 +98,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
return $methods;
}
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
if ( ! $dcc_configuration->is_enabled() ) {
@ -164,7 +164,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
$listener = $c->get( 'wcgateway.settings.listener' );
assert( $listener instanceof SettingsListener );
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
$listener->filter_settings(
@ -247,7 +247,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
add_filter(
'woocommerce_paypal_payments_sdk_components_hook',
function( $components ) use ( $c ) {
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
if ( ! $dcc_configuration->use_fastlane() ) {
@ -262,7 +262,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
'wp_head',
function () use ( $c ) {
// Add meta tag to allow feature-detection of the site's AXO payment state.
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
if ( $dcc_configuration->use_fastlane() ) {
@ -403,7 +403,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
* @return bool
*/
private function should_render_fastlane( ContainerInterface $c ): bool {
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
$subscription_helper = $c->get( 'wc-subscriptions.helper' );

View file

@ -115,7 +115,7 @@ return array(
}
$no_smart_buttons = ! $settings_status->is_smart_button_enabled_for_location( $context );
$dcc_configuration = $container->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $container->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
if ( $no_smart_buttons && ! $dcc_configuration->is_enabled() ) {
@ -168,7 +168,7 @@ return array(
$container->get( 'woocommerce.logger.woocommerce' ),
$container->get( 'button.handle-shipping-in-paypal' ),
$container->get( 'button.helper.disabled-funding-sources' ),
$container->get( 'wcgateway.configuration.dcc' )
$container->get( 'wcgateway.configuration.card-configuration' )
);
},
'button.url' => static function ( ContainerInterface $container ): string {
@ -345,7 +345,7 @@ return array(
return new DisabledFundingSources(
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.all-funding-sources' ),
$container->get( 'wcgateway.configuration.dcc' )
$container->get( 'wcgateway.configuration.card-configuration' )
);
},
'button.is-logged-in' => static function ( ContainerInterface $container ): bool {

View file

@ -54,7 +54,7 @@ class CardFieldsModule implements ServiceModule, ExtendingModule, ExecutableModu
add_filter(
'woocommerce_paypal_payments_sdk_components_hook',
static function( $components ) use ( $c ) {
$dcc_config = $c->get( 'wcgateway.configuration.dcc' );
$dcc_config = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_config instanceof DCCGatewayConfiguration );
if ( ! $dcc_config->is_enabled() ) {
@ -81,7 +81,7 @@ class CardFieldsModule implements ServiceModule, ExtendingModule, ExecutableModu
* @psalm-suppress MissingClosureParamType
*/
function( $default_fields, $id ) use ( $c ) {
if ( ! $c->get( 'wcgateway.configuration.dcc' )->is_enabled() ) {
if ( ! $c->get( 'wcgateway.configuration.card-configuration' )->is_enabled() ) {
return $default_fields;
}
if ( CreditCardGateway::ID === $id && apply_filters( 'woocommerce_paypal_payments_enable_cardholder_name_field', false ) ) {
@ -116,7 +116,7 @@ class CardFieldsModule implements ServiceModule, ExtendingModule, ExecutableModu
add_filter(
'ppcp_create_order_request_body_data',
function( array $data, string $payment_method ) use ( $c ): array {
if ( ! $c->get( 'wcgateway.configuration.dcc' )->is_enabled() ) {
if ( ! $c->get( 'wcgateway.configuration.card-configuration' )->is_enabled() ) {
return $data;
}
// phpcs:ignore WordPress.Security.NonceVerification.Missing

View file

@ -118,7 +118,7 @@ return array(
$container->get( 'wcgateway.settings.render' ),
$container->get( 'wcgateway.order-processor' ),
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.configuration.dcc' ),
$container->get( 'wcgateway.configuration.card-configuration' ),
$container->get( 'wcgateway.credit-card-icons' ),
$container->get( 'wcgateway.url' ),
$container->get( 'session.handler' ),
@ -335,7 +335,7 @@ return array(
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.is-wc-payments-page' ),
$container->get( 'wcgateway.is-ppcp-settings-page' ),
$container->get( 'wcgateway.configuration.dcc' )
$container->get( 'wcgateway.configuration.card-configuration' )
);
},
'wcgateway.notice.card-button-without-paypal' => static function ( ContainerInterface $container ): GatewayWithoutPayPalAdminNotice {
@ -345,7 +345,7 @@ return array(
$container->get( 'wcgateway.settings' ),
$container->get( 'wcgateway.is-wc-payments-page' ),
$container->get( 'wcgateway.is-ppcp-settings-page' ),
$container->get( 'wcgateway.configuration.dcc' ),
$container->get( 'wcgateway.configuration.card-configuration' ),
$container->get( 'wcgateway.settings.status' )
);
},
@ -464,7 +464,7 @@ return array(
assert( $settings instanceof Settings );
$axo_available = $container->has( 'axo.available' ) && $container->get( 'axo.available' );
$dcc_configuration = $container->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $container->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
if ( $axo_available && $dcc_configuration->use_fastlane() ) {
@ -687,7 +687,7 @@ return array(
$subscription_helper = $container->get( 'wc-subscriptions.helper' );
assert( $subscription_helper instanceof SubscriptionHelper );
$dcc_configuration = $container->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $container->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
$fields = array(
@ -1362,7 +1362,7 @@ return array(
return new TransactionUrlProvider( $sandbox_url_base, $live_url_base );
},
'wcgateway.configuration.dcc' => static function ( ContainerInterface $container ) : DCCGatewayConfiguration {
'wcgateway.configuration.card-configuration' => static function ( ContainerInterface $container ) : DCCGatewayConfiguration {
$connection_state = $container->get( 'settings.connection-state' );
assert( $connection_state instanceof ConnectionState );

View file

@ -34,7 +34,7 @@ use WooCommerce\PayPalCommerce\Axo\Helper\PropertiesDictionary;
* - ACDC and AXO use "card-fields"
* - BCDC uses "hosted-fields"
*
* DI service: 'wcgateway.configuration.dcc'
* DI service: 'wcgateway.configuration.card-configuration'
*
* @todo: Rename this class to CardPaymentsConfiguration!
*/

View file

@ -195,7 +195,7 @@ class WCGatewayModule implements ServiceModule, ExtendingModule, ExecutableModul
$settings = $c->get( 'wcgateway.settings' );
assert( $settings instanceof Settings );
$dcc_configuration = $c->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
$assets = new SettingsPageAssets(
@ -614,7 +614,7 @@ class WCGatewayModule implements ServiceModule, ExtendingModule, ExecutableModul
return $methods;
}
$dcc_configuration = $container->get( 'wcgateway.configuration.dcc' );
$dcc_configuration = $container->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
$standard_card_button = get_option( 'woocommerce_ppcp-card-button-gateway_settings' );