mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Update parameter name
Fixes PHPCS
This commit is contained in:
parent
3a72a73ae3
commit
df185157bd
12 changed files with 77 additions and 77 deletions
|
@ -32,11 +32,11 @@ class AdminNotices implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
add_action(
|
||||
'admin_notices',
|
||||
function() use ( $container ) {
|
||||
$renderer = $container->get( 'admin-notices.renderer' );
|
||||
function() use ( $c ) {
|
||||
$renderer = $c->get( 'admin-notices.renderer' );
|
||||
$renderer->render();
|
||||
}
|
||||
);
|
||||
|
|
|
@ -32,7 +32,7 @@ class ApiModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
add_action(
|
||||
'woocommerce_after_calculate_totals',
|
||||
function ( \WC_Cart $cart ) {
|
||||
|
|
|
@ -39,15 +39,15 @@ class ButtonModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
|
||||
add_action(
|
||||
'wp',
|
||||
static function () use ( $container ) {
|
||||
static function () use ( $c ) {
|
||||
if ( is_admin() ) {
|
||||
return;
|
||||
}
|
||||
$smart_button = $container->get( 'button.smart-button' );
|
||||
$smart_button = $c->get( 'button.smart-button' );
|
||||
/**
|
||||
* The Smart Button.
|
||||
*
|
||||
|
@ -58,9 +58,9 @@ class ButtonModule implements ModuleInterface {
|
|||
);
|
||||
add_action(
|
||||
'wp_enqueue_scripts',
|
||||
static function () use ( $container ) {
|
||||
static function () use ( $c ) {
|
||||
|
||||
$smart_button = $container->get( 'button.smart-button' );
|
||||
$smart_button = $c->get( 'button.smart-button' );
|
||||
/**
|
||||
* The Smart Button.
|
||||
*
|
||||
|
@ -72,8 +72,8 @@ class ButtonModule implements ModuleInterface {
|
|||
|
||||
add_filter(
|
||||
'woocommerce_create_order',
|
||||
static function ( $value ) use ( $container ) {
|
||||
$early_order_handler = $container->get( 'button.helper.early-order-handler' );
|
||||
static function ( $value ) use ( $c ) {
|
||||
$early_order_handler = $c->get( 'button.helper.early-order-handler' );
|
||||
if ( ! is_null( $value ) ) {
|
||||
$value = (int) $value;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class ButtonModule implements ModuleInterface {
|
|||
}
|
||||
);
|
||||
|
||||
$this->register_ajax_endpoints( $container );
|
||||
$this->register_ajax_endpoints( $c );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -35,10 +35,10 @@ class CompatModule implements ModuleInterface {
|
|||
/**
|
||||
* Run the compatibility module.
|
||||
*
|
||||
* @param ContainerInterface|null $container The Container.
|
||||
* @param ContainerInterface|null $c The Container.
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
$this->initialize_ppec_compat_layer( $container );
|
||||
public function run( ContainerInterface $c ): void {
|
||||
$this->initialize_ppec_compat_layer( $c );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,9 +36,9 @@ class OnboardingModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
|
||||
$asset_loader = $container->get( 'onboarding.assets' );
|
||||
$asset_loader = $c->get( 'onboarding.assets' );
|
||||
/**
|
||||
* The OnboardingAssets.
|
||||
*
|
||||
|
@ -61,11 +61,11 @@ class OnboardingModule implements ModuleInterface {
|
|||
|
||||
add_filter(
|
||||
'woocommerce_form_field',
|
||||
static function ( $field, $key, $config ) use ( $container ) {
|
||||
static function ( $field, $key, $config ) use ( $c ) {
|
||||
if ( 'ppcp_onboarding' !== $config['type'] ) {
|
||||
return $field;
|
||||
}
|
||||
$renderer = $container->get( 'onboarding.render' );
|
||||
$renderer = $c->get( 'onboarding.render' );
|
||||
$is_production = 'production' === $config['env'];
|
||||
|
||||
/**
|
||||
|
@ -85,8 +85,8 @@ class OnboardingModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
'wc_ajax_' . LoginSellerEndpoint::ENDPOINT,
|
||||
static function () use ( $container ) {
|
||||
$endpoint = $container->get( 'onboarding.endpoint.login-seller' );
|
||||
static function () use ( $c ) {
|
||||
$endpoint = $c->get( 'onboarding.endpoint.login-seller' );
|
||||
|
||||
/**
|
||||
* The ChangeCartEndpoint.
|
||||
|
@ -98,7 +98,7 @@ class OnboardingModule implements ModuleInterface {
|
|||
);
|
||||
|
||||
// Initialize REST routes at the appropriate time.
|
||||
$rest_controller = $container->get( 'onboarding.rest' );
|
||||
$rest_controller = $c->get( 'onboarding.rest' );
|
||||
add_action( 'rest_api_init', array( $rest_controller, 'register_routes' ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -33,11 +33,11 @@ class SessionModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
add_action(
|
||||
'woocommerce_init',
|
||||
function () use ( $container ) {
|
||||
$controller = $container->get( 'session.cancellation.controller' );
|
||||
function () use ( $c ) {
|
||||
$controller = $c->get( 'session.cancellation.controller' );
|
||||
/**
|
||||
* The Cancel controller.
|
||||
*
|
||||
|
|
|
@ -38,27 +38,27 @@ class StatusReportModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param ContainerInterface $container A services container instance.
|
||||
* @param ContainerInterface $c A services container instance.
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
add_action(
|
||||
'woocommerce_system_status_report',
|
||||
function () use ( $container ) {
|
||||
function () use ( $c ) {
|
||||
|
||||
/* @var State $state The state. */
|
||||
$state = $container->get( 'onboarding.state' );
|
||||
$state = $c->get( 'onboarding.state' );
|
||||
|
||||
/* @var Bearer $bearer The bearer. */
|
||||
$bearer = $container->get( 'api.bearer' );
|
||||
$bearer = $c->get( 'api.bearer' );
|
||||
|
||||
/* @var DccApplies $dcc_applies The ddc applies. */
|
||||
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
|
||||
$dcc_applies = $c->get( 'api.helpers.dccapplies' );
|
||||
|
||||
/* @var MessagesApply $messages_apply The messages apply. */
|
||||
$messages_apply = $container->get( 'button.helper.messages-apply' );
|
||||
$messages_apply = $c->get( 'button.helper.messages-apply' );
|
||||
|
||||
/* @var Renderer $renderer The renderer. */
|
||||
$renderer = $container->get( 'status-report.renderer' );
|
||||
$renderer = $c->get( 'status-report.renderer' );
|
||||
|
||||
$items = array(
|
||||
array(
|
||||
|
|
|
@ -40,11 +40,11 @@ class SubscriptionModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
add_action(
|
||||
'woocommerce_scheduled_subscription_payment_' . PayPalGateway::ID,
|
||||
function ( $amount, $order ) use ( $container ) {
|
||||
$this->renew( $order, $container );
|
||||
function ( $amount, $order ) use ( $c ) {
|
||||
$this->renew( $order, $c );
|
||||
},
|
||||
10,
|
||||
2
|
||||
|
@ -52,8 +52,8 @@ class SubscriptionModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
'woocommerce_scheduled_subscription_payment_' . CreditCardGateway::ID,
|
||||
function ( $amount, $order ) use ( $container ) {
|
||||
$this->renew( $order, $container );
|
||||
function ( $amount, $order ) use ( $c ) {
|
||||
$this->renew( $order, $c );
|
||||
},
|
||||
10,
|
||||
2
|
||||
|
@ -61,9 +61,9 @@ class SubscriptionModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
'woocommerce_subscription_payment_complete',
|
||||
function ( $subscription ) use ( $container ) {
|
||||
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
|
||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||
function ( $subscription ) use ( $c ) {
|
||||
$payment_token_repository = $c->get( 'subscription.repository.payment-token' );
|
||||
$logger = $c->get( 'woocommerce.logger.woocommerce' );
|
||||
|
||||
$this->add_payment_token_id( $subscription, $payment_token_repository, $logger );
|
||||
}
|
||||
|
@ -71,10 +71,10 @@ class SubscriptionModule implements ModuleInterface {
|
|||
|
||||
add_filter(
|
||||
'woocommerce_gateway_description',
|
||||
function ( $description, $id ) use ( $container ) {
|
||||
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
$subscription_helper = $container->get( 'subscription.helper' );
|
||||
function ( $description, $id ) use ( $c ) {
|
||||
$payment_token_repository = $c->get( 'subscription.repository.payment-token' );
|
||||
$settings = $c->get( 'wcgateway.settings' );
|
||||
$subscription_helper = $c->get( 'subscription.helper' );
|
||||
|
||||
return $this->display_saved_paypal_payments( $settings, (string) $id, $payment_token_repository, (string) $description, $subscription_helper );
|
||||
},
|
||||
|
@ -84,10 +84,10 @@ class SubscriptionModule implements ModuleInterface {
|
|||
|
||||
add_filter(
|
||||
'woocommerce_credit_card_form_fields',
|
||||
function ( $default_fields, $id ) use ( $container ) {
|
||||
$payment_token_repository = $container->get( 'subscription.repository.payment-token' );
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
$subscription_helper = $container->get( 'subscription.helper' );
|
||||
function ( $default_fields, $id ) use ( $c ) {
|
||||
$payment_token_repository = $c->get( 'subscription.repository.payment-token' );
|
||||
$settings = $c->get( 'wcgateway.settings' );
|
||||
$subscription_helper = $c->get( 'subscription.helper' );
|
||||
|
||||
return $this->display_saved_credit_cards( $settings, $id, $payment_token_repository, $default_fields, $subscription_helper );
|
||||
},
|
||||
|
|
|
@ -49,17 +49,17 @@ class WcGatewayModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
$this->register_payment_gateways( $container );
|
||||
$this->register_order_functionality( $container );
|
||||
$this->register_columns( $container );
|
||||
$this->register_checkout_paypal_address_preset( $container );
|
||||
$this->ajax_gateway_enabler( $container );
|
||||
public function run( ContainerInterface $c ): void {
|
||||
$this->register_payment_gateways( $c );
|
||||
$this->register_order_functionality( $c );
|
||||
$this->register_columns( $c );
|
||||
$this->register_checkout_paypal_address_preset( $c );
|
||||
$this->ajax_gateway_enabler( $c );
|
||||
|
||||
add_action(
|
||||
'woocommerce_sections_checkout',
|
||||
function() use ( $container ) {
|
||||
$section_renderer = $container->get( 'wcgateway.settings.sections-renderer' );
|
||||
function() use ( $c ) {
|
||||
$section_renderer = $c->get( 'wcgateway.settings.sections-renderer' );
|
||||
/**
|
||||
* The Section Renderer.
|
||||
*
|
||||
|
@ -69,19 +69,19 @@ class WcGatewayModule implements ModuleInterface {
|
|||
}
|
||||
);
|
||||
|
||||
if ( $container->has( 'wcgateway.url' ) ) {
|
||||
if ( $c->has( 'wcgateway.url' ) ) {
|
||||
$assets = new SettingsPageAssets(
|
||||
$container->get( 'wcgateway.url' ),
|
||||
$container->get( 'wcgateway.absolute-path' ),
|
||||
$container->get( 'api.bearer' )
|
||||
$c->get( 'wcgateway.url' ),
|
||||
$c->get( 'wcgateway.absolute-path' ),
|
||||
$c->get( 'api.bearer' )
|
||||
);
|
||||
$assets->register_assets();
|
||||
}
|
||||
|
||||
add_filter(
|
||||
Repository::NOTICES_FILTER,
|
||||
static function ( $notices ) use ( $container ): array {
|
||||
$notice = $container->get( 'wcgateway.notice.connect' );
|
||||
static function ( $notices ) use ( $c ): array {
|
||||
$notice = $c->get( 'wcgateway.notice.connect' );
|
||||
/**
|
||||
* The Connect Admin Notice object.
|
||||
*
|
||||
|
@ -91,13 +91,13 @@ class WcGatewayModule implements ModuleInterface {
|
|||
if ( $connect_message ) {
|
||||
$notices[] = $connect_message;
|
||||
}
|
||||
$authorize_order_action = $container->get( 'wcgateway.notice.authorize-order-action' );
|
||||
$authorize_order_action = $c->get( 'wcgateway.notice.authorize-order-action' );
|
||||
$authorized_message = $authorize_order_action->message();
|
||||
if ( $authorized_message ) {
|
||||
$notices[] = $authorized_message;
|
||||
}
|
||||
|
||||
$settings_renderer = $container->get( 'wcgateway.settings.render' );
|
||||
$settings_renderer = $c->get( 'wcgateway.settings.render' );
|
||||
/**
|
||||
* The settings renderer.
|
||||
*
|
||||
|
@ -111,7 +111,7 @@ class WcGatewayModule implements ModuleInterface {
|
|||
);
|
||||
add_action(
|
||||
'woocommerce_paypal_commerce_gateway_deactivate',
|
||||
static function () use ( $container ) {
|
||||
static function () use ( $c ) {
|
||||
delete_option( Settings::KEY );
|
||||
delete_option( PayPalRequestIdRepository::KEY );
|
||||
delete_option( 'woocommerce_' . PayPalGateway::ID . '_settings' );
|
||||
|
@ -121,8 +121,8 @@ class WcGatewayModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
'wc_ajax_' . ReturnUrlEndpoint::ENDPOINT,
|
||||
static function () use ( $container ) {
|
||||
$endpoint = $container->get( 'wcgateway.endpoint.return-url' );
|
||||
static function () use ( $c ) {
|
||||
$endpoint = $c->get( 'wcgateway.endpoint.return-url' );
|
||||
/**
|
||||
* The Endpoint.
|
||||
*
|
||||
|
|
|
@ -32,11 +32,11 @@ class WebhookModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
add_action(
|
||||
'rest_api_init',
|
||||
static function () use ( $container ) {
|
||||
$endpoint = $container->get( 'webhook.endpoint.controller' );
|
||||
static function () use ( $c ) {
|
||||
$endpoint = $c->get( 'webhook.endpoint.controller' );
|
||||
/**
|
||||
* The Incoming Webhook Endpoint.
|
||||
*
|
||||
|
@ -48,8 +48,8 @@ class WebhookModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
WebhookRegistrar::EVENT_HOOK,
|
||||
static function () use ( $container ) {
|
||||
$registrar = $container->get( 'webhook.registrar' );
|
||||
static function () use ( $c ) {
|
||||
$registrar = $c->get( 'webhook.registrar' );
|
||||
/**
|
||||
* The Webhook Registrar.
|
||||
*
|
||||
|
@ -61,8 +61,8 @@ class WebhookModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
'woocommerce_paypal_payments_gateway_deactivate',
|
||||
static function () use ( $container ) {
|
||||
$registrar = $container->get( 'webhook.registrar' );
|
||||
static function () use ( $c ) {
|
||||
$registrar = $c->get( 'webhook.registrar' );
|
||||
/**
|
||||
* The Webhook Registrar.
|
||||
*
|
||||
|
|
|
@ -32,7 +32,7 @@ class WooCommerceLoggingModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class PluginModule implements ModuleInterface {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
public function run( ContainerInterface $c ): void {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue