Skip to content

Commit 37b2447

Browse files
committed
🎨 Fix PHPCS coding standards violations
1 parent 57f0a05 commit 37b2447

3 files changed

Lines changed: 31 additions & 31 deletions

File tree

‎modules/ppcp-compat/services.php‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
return array(
2929

30-
'compat.ppec.mock-gateway' => static function ( $container ) {
30+
'compat.ppec.mock-gateway' => static function ( $container ) {
3131
$settings = $container->get( 'settings.settings-provider' );
3232
assert( $settings instanceof SettingsProvider );
3333

@@ -40,15 +40,15 @@
4040
return new PPEC\MockGateway( $title );
4141
},
4242

43-
'compat.ppec.billing-agreement-converter' => static function ( ContainerInterface $container ) {
43+
'compat.ppec.billing-agreement-converter' => static function ( ContainerInterface $container ) {
4444
return new PPEC\BillingAgreementTokenConverter(
4545
$container->get( 'api.endpoint.payment-method-tokens' ),
4646
$container->get( 'api.repository.customer' ),
4747
$container->get( 'woocommerce.logger.woocommerce' )
4848
);
4949
},
5050

51-
'compat.ppec.subscriptions-handler' => static function ( ContainerInterface $container ) {
51+
'compat.ppec.subscriptions-handler' => static function ( ContainerInterface $container ) {
5252
return new PPEC\SubscriptionsHandler(
5353
$container->get( 'wc-subscriptions.renewal-handler' ),
5454
$container->get( 'compat.ppec.mock-gateway' ),
@@ -57,7 +57,7 @@
5757
);
5858
},
5959

60-
'compat.plugin-script-names' => static function ( ContainerInterface $container ): array {
60+
'compat.plugin-script-names' => static function ( ContainerInterface $container ): array {
6161
return array(
6262
'ppcp-smart-button',
6363
'ppcp-oxxo',
@@ -71,7 +71,7 @@
7171
);
7272
},
7373

74-
'compat.plugin-script-file-names' => static function ( ContainerInterface $container ): array {
74+
'compat.plugin-script-file-names' => static function ( ContainerInterface $container ): array {
7575
return array(
7676
'button.js',
7777
'gateway-settings.js',
@@ -81,18 +81,18 @@
8181
);
8282
},
8383

84-
'compat.shiptastic.is_supported_plugin_version_active' => function (): bool {
84+
'compat.shiptastic.is_supported_plugin_version_active' => function (): bool {
8585
return function_exists( 'wc_stc_get_shipments' );
8686
},
8787

8888
'compat.wc_shipment_tracking.is_supported_plugin_version_active' => function (): bool {
8989
return class_exists( 'WC_Shipment_Tracking' );
9090
},
9191

92-
'compat.ywot.is_supported_plugin_version_active' => function (): bool {
92+
'compat.ywot.is_supported_plugin_version_active' => function (): bool {
9393
return function_exists( 'yith_ywot_init' );
9494
},
95-
'compat.dhl.is_supported_plugin_version_active' => function (): bool {
95+
'compat.dhl.is_supported_plugin_version_active' => function (): bool {
9696
return function_exists( 'PR_DHL' );
9797
},
9898
'compat.shipstation.is_supported_plugin_version_active' => function (): bool {
@@ -101,21 +101,21 @@
101101
'compat.wc_shipping_tax.is_supported_plugin_version_active' => function (): bool {
102102
return class_exists( 'WC_Connect_Loader' );
103103
},
104-
'compat.nyp.is_supported_plugin_version_active' => function (): bool {
104+
'compat.nyp.is_supported_plugin_version_active' => function (): bool {
105105
return function_exists( 'wc_nyp_init' );
106106
},
107107
'compat.wc_bookings.is_supported_plugin_version_active' => function (): bool {
108108
return class_exists( 'WC_Bookings' );
109109
},
110110

111-
'compat.asset_getter' => static function ( ContainerInterface $container ): AssetGetter {
111+
'compat.asset_getter' => static function ( ContainerInterface $container ): AssetGetter {
112112
$factory = $container->get( 'assets.asset_getter_factory' );
113113
assert( $factory instanceof AssetGetterFactory );
114114

115115
return $factory->for_module( 'ppcp-compat' );
116116
},
117117

118-
'compat.assets' => function ( ContainerInterface $container ): CompatAssets {
118+
'compat.assets' => function ( ContainerInterface $container ): CompatAssets {
119119
return new CompatAssets(
120120
$container->get( 'compat.asset_getter' ),
121121
$container->get( 'ppcp.asset-version' ),
@@ -131,7 +131,7 @@
131131
*
132132
* @returns SettingsMap[]
133133
*/
134-
'compat.setting.new-to-old-map' => static function ( ContainerInterface $container ): array {
134+
'compat.setting.new-to-old-map' => static function ( ContainerInterface $container ): array {
135135
$are_new_settings_enabled = $container->get( 'wcgateway.settings.admin-settings-enabled' );
136136
if ( ! $are_new_settings_enabled ) {
137137
return array();
@@ -195,7 +195,7 @@
195195
),
196196
);
197197
},
198-
'compat.settings.settings_map_helper' => static function ( ContainerInterface $container ): SettingsMapHelper {
198+
'compat.settings.settings_map_helper' => static function ( ContainerInterface $container ): SettingsMapHelper {
199199
return new SettingsMapHelper(
200200
$container->get( 'compat.setting.new-to-old-map' ),
201201
$container->get( 'compat.settings.styling_map_helper' ),
@@ -206,36 +206,36 @@
206206
$container->get( 'wcgateway.settings.admin-settings-enabled' )
207207
);
208208
},
209-
'compat.settings.styling_map_helper' => static function ( ContainerInterface $container ): StylingSettingsMapHelper {
209+
'compat.settings.styling_map_helper' => static function ( ContainerInterface $container ): StylingSettingsMapHelper {
210210
$context_provider = static function () use ( $container ): string {
211211
$context = $container->get( 'button.helper.context' );
212212

213213
return $context->context();
214214
};
215215
return new StylingSettingsMapHelper( $context_provider );
216216
},
217-
'compat.settings.settings_tab_map_helper' => static function (): SettingsTabMapHelper {
217+
'compat.settings.settings_tab_map_helper' => static function (): SettingsTabMapHelper {
218218
return new SettingsTabMapHelper();
219219
},
220-
'compat.settings.subscription_map_helper' => static function ( ContainerInterface $container ): SubscriptionSettingsMapHelper {
220+
'compat.settings.subscription_map_helper' => static function ( ContainerInterface $container ): SubscriptionSettingsMapHelper {
221221
return new SubscriptionSettingsMapHelper( $container->get( 'wc-subscriptions.helper' ) );
222222
},
223-
'compat.settings.general_map_helper' => static function (): GeneralSettingsMapHelper {
223+
'compat.settings.general_map_helper' => static function (): GeneralSettingsMapHelper {
224224
return new GeneralSettingsMapHelper();
225225
},
226-
'compat.settings.payment_methods_map_helper' => static function (): PaymentMethodSettingsMapHelper {
226+
'compat.settings.payment_methods_map_helper' => static function (): PaymentMethodSettingsMapHelper {
227227
return new PaymentMethodSettingsMapHelper();
228228
},
229-
'compat.blueprint.is_available' => function (): bool {
229+
'compat.blueprint.is_available' => function (): bool {
230230
return interface_exists( 'Automattic\WooCommerce\Blueprint\Exporters\StepExporter' );
231231
},
232-
'compat.blueprint.paypal_settings_exporter' => static function ( ContainerInterface $container ): PayPalSettingsExporter {
232+
'compat.blueprint.paypal_settings_exporter' => static function ( ContainerInterface $container ): PayPalSettingsExporter {
233233
return new PayPalSettingsExporter();
234234
},
235-
'compat.blueprint.paypal_settings_importer' => static function ( ContainerInterface $container ): PayPalSettingsImporter {
235+
'compat.blueprint.paypal_settings_importer' => static function ( ContainerInterface $container ): PayPalSettingsImporter {
236236
return new PayPalSettingsImporter();
237237
},
238-
'compat.blueprint.bootstrap' => static function ( ContainerInterface $container ): PayPalBlueprintBootstrap {
238+
'compat.blueprint.bootstrap' => static function ( ContainerInterface $container ): PayPalBlueprintBootstrap {
239239
return new PayPalBlueprintBootstrap(
240240
$container->get( 'compat.blueprint.paypal_settings_exporter' ),
241241
$container->get( 'compat.blueprint.paypal_settings_importer' )

‎modules/ppcp-compat/src/Settings/SettingsMapHelper.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function __construct(
125125
* @param SettingsMap[] $settings_map The settings map to validate.
126126
* @throws RuntimeException When an old key has multiple mappings.
127127
*/
128-
protected function validate_settings_map( array $settings_map ) : void {
128+
protected function validate_settings_map( array $settings_map ): void {
129129
$seen_keys = array();
130130

131131
foreach ( $settings_map as $settings_map_instance ) {
@@ -172,7 +172,7 @@ public function mapped_value( string $old_key ) {
172172
*
173173
* @return bool True if the key exists in the new settings, false otherwise.
174174
*/
175-
public function has_mapped_key( string $old_key ) : bool {
175+
public function has_mapped_key( string $old_key ): bool {
176176
if ( ! $this->new_settings_module_enabled ) {
177177
return false;
178178
}
@@ -228,7 +228,7 @@ protected function get_cached_model_value( int $model_id, string $old_key, strin
228228
*
229229
* @return void
230230
*/
231-
protected function ensure_map_initialized() : void {
231+
protected function ensure_map_initialized(): void {
232232
if ( $this->key_to_model === null ) {
233233
$this->initialize_key_map();
234234
}
@@ -242,7 +242,7 @@ protected function ensure_map_initialized() : void {
242242
*
243243
* @return void
244244
*/
245-
protected function initialize_key_map() : void {
245+
protected function initialize_key_map(): void {
246246
$this->key_to_model = array();
247247

248248
foreach ( $this->settings_map as $settings_map_instance ) {
@@ -264,7 +264,7 @@ protected function initialize_key_map() : void {
264264
*
265265
* @return AbstractDataModel|null
266266
*/
267-
protected function get_payment_settings_model() : ?AbstractDataModel {
267+
protected function get_payment_settings_model(): ?AbstractDataModel {
268268
foreach ( $this->settings_map as $settings_map_instance ) {
269269
if ( $settings_map_instance->get_model() instanceof PaymentSettings ) {
270270
return $settings_map_instance->get_model();

‎modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public function __construct(
6969
SessionHandler $session_handler,
7070
LoggerInterface $logger
7171
) {
72-
$this->gateway = $gateway;
73-
$this->order_endpoint = $order_endpoint;
74-
$this->session_handler = $session_handler;
75-
$this->logger = $logger;
72+
$this->gateway = $gateway;
73+
$this->order_endpoint = $order_endpoint;
74+
$this->session_handler = $session_handler;
75+
$this->logger = $logger;
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)