Update parameter name

Fixes PHPCS
This commit is contained in:
Anton Ukhanev 2021-08-30 08:10:43 +02:00
parent 3a72a73ae3
commit df185157bd
12 changed files with 77 additions and 77 deletions

View file

@ -32,11 +32,11 @@ class AdminNotices implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
add_action( add_action(
'admin_notices', 'admin_notices',
function() use ( $container ) { function() use ( $c ) {
$renderer = $container->get( 'admin-notices.renderer' ); $renderer = $c->get( 'admin-notices.renderer' );
$renderer->render(); $renderer->render();
} }
); );

View file

@ -32,7 +32,7 @@ class ApiModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
add_action( add_action(
'woocommerce_after_calculate_totals', 'woocommerce_after_calculate_totals',
function ( \WC_Cart $cart ) { function ( \WC_Cart $cart ) {

View file

@ -39,15 +39,15 @@ class ButtonModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
add_action( add_action(
'wp', 'wp',
static function () use ( $container ) { static function () use ( $c ) {
if ( is_admin() ) { if ( is_admin() ) {
return; return;
} }
$smart_button = $container->get( 'button.smart-button' ); $smart_button = $c->get( 'button.smart-button' );
/** /**
* The Smart Button. * The Smart Button.
* *
@ -58,9 +58,9 @@ class ButtonModule implements ModuleInterface {
); );
add_action( add_action(
'wp_enqueue_scripts', '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. * The Smart Button.
* *
@ -72,8 +72,8 @@ class ButtonModule implements ModuleInterface {
add_filter( add_filter(
'woocommerce_create_order', 'woocommerce_create_order',
static function ( $value ) use ( $container ) { static function ( $value ) use ( $c ) {
$early_order_handler = $container->get( 'button.helper.early-order-handler' ); $early_order_handler = $c->get( 'button.helper.early-order-handler' );
if ( ! is_null( $value ) ) { if ( ! is_null( $value ) ) {
$value = (int) $value; $value = (int) $value;
} }
@ -86,7 +86,7 @@ class ButtonModule implements ModuleInterface {
} }
); );
$this->register_ajax_endpoints( $container ); $this->register_ajax_endpoints( $c );
} }
/** /**

View file

@ -35,10 +35,10 @@ class CompatModule implements ModuleInterface {
/** /**
* Run the compatibility module. * Run the compatibility module.
* *
* @param ContainerInterface|null $container The Container. * @param ContainerInterface|null $c The Container.
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
$this->initialize_ppec_compat_layer( $container ); $this->initialize_ppec_compat_layer( $c );
} }
/** /**

View file

@ -36,9 +36,9 @@ class OnboardingModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@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. * The OnboardingAssets.
* *
@ -61,11 +61,11 @@ class OnboardingModule implements ModuleInterface {
add_filter( add_filter(
'woocommerce_form_field', 'woocommerce_form_field',
static function ( $field, $key, $config ) use ( $container ) { static function ( $field, $key, $config ) use ( $c ) {
if ( 'ppcp_onboarding' !== $config['type'] ) { if ( 'ppcp_onboarding' !== $config['type'] ) {
return $field; return $field;
} }
$renderer = $container->get( 'onboarding.render' ); $renderer = $c->get( 'onboarding.render' );
$is_production = 'production' === $config['env']; $is_production = 'production' === $config['env'];
/** /**
@ -85,8 +85,8 @@ class OnboardingModule implements ModuleInterface {
add_action( add_action(
'wc_ajax_' . LoginSellerEndpoint::ENDPOINT, 'wc_ajax_' . LoginSellerEndpoint::ENDPOINT,
static function () use ( $container ) { static function () use ( $c ) {
$endpoint = $container->get( 'onboarding.endpoint.login-seller' ); $endpoint = $c->get( 'onboarding.endpoint.login-seller' );
/** /**
* The ChangeCartEndpoint. * The ChangeCartEndpoint.
@ -98,7 +98,7 @@ class OnboardingModule implements ModuleInterface {
); );
// Initialize REST routes at the appropriate time. // 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' ) ); add_action( 'rest_api_init', array( $rest_controller, 'register_routes' ) );
} }

View file

@ -33,11 +33,11 @@ class SessionModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
add_action( add_action(
'woocommerce_init', 'woocommerce_init',
function () use ( $container ) { function () use ( $c ) {
$controller = $container->get( 'session.cancellation.controller' ); $controller = $c->get( 'session.cancellation.controller' );
/** /**
* The Cancel controller. * The Cancel controller.
* *

View file

@ -38,27 +38,27 @@ class StatusReportModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@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( add_action(
'woocommerce_system_status_report', 'woocommerce_system_status_report',
function () use ( $container ) { function () use ( $c ) {
/* @var State $state The state. */ /* @var State $state The state. */
$state = $container->get( 'onboarding.state' ); $state = $c->get( 'onboarding.state' );
/* @var Bearer $bearer The bearer. */ /* @var Bearer $bearer The bearer. */
$bearer = $container->get( 'api.bearer' ); $bearer = $c->get( 'api.bearer' );
/* @var DccApplies $dcc_applies The ddc applies. */ /* @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. */ /* @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. */ /* @var Renderer $renderer The renderer. */
$renderer = $container->get( 'status-report.renderer' ); $renderer = $c->get( 'status-report.renderer' );
$items = array( $items = array(
array( array(

View file

@ -40,11 +40,11 @@ class SubscriptionModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
add_action( add_action(
'woocommerce_scheduled_subscription_payment_' . PayPalGateway::ID, 'woocommerce_scheduled_subscription_payment_' . PayPalGateway::ID,
function ( $amount, $order ) use ( $container ) { function ( $amount, $order ) use ( $c ) {
$this->renew( $order, $container ); $this->renew( $order, $c );
}, },
10, 10,
2 2
@ -52,8 +52,8 @@ class SubscriptionModule implements ModuleInterface {
add_action( add_action(
'woocommerce_scheduled_subscription_payment_' . CreditCardGateway::ID, 'woocommerce_scheduled_subscription_payment_' . CreditCardGateway::ID,
function ( $amount, $order ) use ( $container ) { function ( $amount, $order ) use ( $c ) {
$this->renew( $order, $container ); $this->renew( $order, $c );
}, },
10, 10,
2 2
@ -61,9 +61,9 @@ class SubscriptionModule implements ModuleInterface {
add_action( add_action(
'woocommerce_subscription_payment_complete', 'woocommerce_subscription_payment_complete',
function ( $subscription ) use ( $container ) { function ( $subscription ) use ( $c ) {
$payment_token_repository = $container->get( 'subscription.repository.payment-token' ); $payment_token_repository = $c->get( 'subscription.repository.payment-token' );
$logger = $container->get( 'woocommerce.logger.woocommerce' ); $logger = $c->get( 'woocommerce.logger.woocommerce' );
$this->add_payment_token_id( $subscription, $payment_token_repository, $logger ); $this->add_payment_token_id( $subscription, $payment_token_repository, $logger );
} }
@ -71,10 +71,10 @@ class SubscriptionModule implements ModuleInterface {
add_filter( add_filter(
'woocommerce_gateway_description', 'woocommerce_gateway_description',
function ( $description, $id ) use ( $container ) { function ( $description, $id ) use ( $c ) {
$payment_token_repository = $container->get( 'subscription.repository.payment-token' ); $payment_token_repository = $c->get( 'subscription.repository.payment-token' );
$settings = $container->get( 'wcgateway.settings' ); $settings = $c->get( 'wcgateway.settings' );
$subscription_helper = $container->get( 'subscription.helper' ); $subscription_helper = $c->get( 'subscription.helper' );
return $this->display_saved_paypal_payments( $settings, (string) $id, $payment_token_repository, (string) $description, $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( add_filter(
'woocommerce_credit_card_form_fields', 'woocommerce_credit_card_form_fields',
function ( $default_fields, $id ) use ( $container ) { function ( $default_fields, $id ) use ( $c ) {
$payment_token_repository = $container->get( 'subscription.repository.payment-token' ); $payment_token_repository = $c->get( 'subscription.repository.payment-token' );
$settings = $container->get( 'wcgateway.settings' ); $settings = $c->get( 'wcgateway.settings' );
$subscription_helper = $container->get( 'subscription.helper' ); $subscription_helper = $c->get( 'subscription.helper' );
return $this->display_saved_credit_cards( $settings, $id, $payment_token_repository, $default_fields, $subscription_helper ); return $this->display_saved_credit_cards( $settings, $id, $payment_token_repository, $default_fields, $subscription_helper );
}, },

View file

@ -49,17 +49,17 @@ class WcGatewayModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
$this->register_payment_gateways( $container ); $this->register_payment_gateways( $c );
$this->register_order_functionality( $container ); $this->register_order_functionality( $c );
$this->register_columns( $container ); $this->register_columns( $c );
$this->register_checkout_paypal_address_preset( $container ); $this->register_checkout_paypal_address_preset( $c );
$this->ajax_gateway_enabler( $container ); $this->ajax_gateway_enabler( $c );
add_action( add_action(
'woocommerce_sections_checkout', 'woocommerce_sections_checkout',
function() use ( $container ) { function() use ( $c ) {
$section_renderer = $container->get( 'wcgateway.settings.sections-renderer' ); $section_renderer = $c->get( 'wcgateway.settings.sections-renderer' );
/** /**
* The Section 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( $assets = new SettingsPageAssets(
$container->get( 'wcgateway.url' ), $c->get( 'wcgateway.url' ),
$container->get( 'wcgateway.absolute-path' ), $c->get( 'wcgateway.absolute-path' ),
$container->get( 'api.bearer' ) $c->get( 'api.bearer' )
); );
$assets->register_assets(); $assets->register_assets();
} }
add_filter( add_filter(
Repository::NOTICES_FILTER, Repository::NOTICES_FILTER,
static function ( $notices ) use ( $container ): array { static function ( $notices ) use ( $c ): array {
$notice = $container->get( 'wcgateway.notice.connect' ); $notice = $c->get( 'wcgateway.notice.connect' );
/** /**
* The Connect Admin Notice object. * The Connect Admin Notice object.
* *
@ -91,13 +91,13 @@ class WcGatewayModule implements ModuleInterface {
if ( $connect_message ) { if ( $connect_message ) {
$notices[] = $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(); $authorized_message = $authorize_order_action->message();
if ( $authorized_message ) { if ( $authorized_message ) {
$notices[] = $authorized_message; $notices[] = $authorized_message;
} }
$settings_renderer = $container->get( 'wcgateway.settings.render' ); $settings_renderer = $c->get( 'wcgateway.settings.render' );
/** /**
* The settings renderer. * The settings renderer.
* *
@ -111,7 +111,7 @@ class WcGatewayModule implements ModuleInterface {
); );
add_action( add_action(
'woocommerce_paypal_commerce_gateway_deactivate', 'woocommerce_paypal_commerce_gateway_deactivate',
static function () use ( $container ) { static function () use ( $c ) {
delete_option( Settings::KEY ); delete_option( Settings::KEY );
delete_option( PayPalRequestIdRepository::KEY ); delete_option( PayPalRequestIdRepository::KEY );
delete_option( 'woocommerce_' . PayPalGateway::ID . '_settings' ); delete_option( 'woocommerce_' . PayPalGateway::ID . '_settings' );
@ -121,8 +121,8 @@ class WcGatewayModule implements ModuleInterface {
add_action( add_action(
'wc_ajax_' . ReturnUrlEndpoint::ENDPOINT, 'wc_ajax_' . ReturnUrlEndpoint::ENDPOINT,
static function () use ( $container ) { static function () use ( $c ) {
$endpoint = $container->get( 'wcgateway.endpoint.return-url' ); $endpoint = $c->get( 'wcgateway.endpoint.return-url' );
/** /**
* The Endpoint. * The Endpoint.
* *

View file

@ -32,11 +32,11 @@ class WebhookModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
add_action( add_action(
'rest_api_init', 'rest_api_init',
static function () use ( $container ) { static function () use ( $c ) {
$endpoint = $container->get( 'webhook.endpoint.controller' ); $endpoint = $c->get( 'webhook.endpoint.controller' );
/** /**
* The Incoming Webhook Endpoint. * The Incoming Webhook Endpoint.
* *
@ -48,8 +48,8 @@ class WebhookModule implements ModuleInterface {
add_action( add_action(
WebhookRegistrar::EVENT_HOOK, WebhookRegistrar::EVENT_HOOK,
static function () use ( $container ) { static function () use ( $c ) {
$registrar = $container->get( 'webhook.registrar' ); $registrar = $c->get( 'webhook.registrar' );
/** /**
* The Webhook Registrar. * The Webhook Registrar.
* *
@ -61,8 +61,8 @@ class WebhookModule implements ModuleInterface {
add_action( add_action(
'woocommerce_paypal_payments_gateway_deactivate', 'woocommerce_paypal_payments_gateway_deactivate',
static function () use ( $container ) { static function () use ( $c ) {
$registrar = $container->get( 'webhook.registrar' ); $registrar = $c->get( 'webhook.registrar' );
/** /**
* The Webhook Registrar. * The Webhook Registrar.
* *

View file

@ -32,7 +32,7 @@ class WooCommerceLoggingModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
} }

View file

@ -29,7 +29,7 @@ class PluginModule implements ModuleInterface {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public function run( ContainerInterface $container ): void { public function run( ContainerInterface $c ): void {
} }
/** /**