Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jan 31, 2025
1 parent 536c71d commit 6a00f1b
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Assets/AssetsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,11 @@ protected function setupModuleActions(ContainerInterface $container): void
$settingsHelper = $container->get('settings.settings_helper');
$gatewayInstances = $container->get('__deprecated.gateway_helpers');

add_action('woocommerce_blocks_loaded', function () {
add_action('woocommerce_blocks_loaded', static function () {
woocommerce_store_api_register_update_callback(
[
'namespace' => 'mollie-payments-for-woocommerce',
'callback' => function () {
'callback' => static function () {
// Do nothing
},
]
Expand Down
1 change: 1 addition & 0 deletions src/Gateway/GatewayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ protected function instantiatePaymentMethods(): array
public function buildPaymentMethod(
string $id
) {

$transformedId = ucfirst($id);
$paymentMethodClassName = 'Mollie\\WooCommerce\\PaymentMethods\\' . $transformedId;

Expand Down
2 changes: 1 addition & 1 deletion src/Gateway/inc/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
//we want only the methods after the feature flags
return array_filter($allPaymentMethods, static function ($method, $key) use ($onlyAvailableMethods) {
return array_key_exists($key, $onlyAvailableMethods);
}, ARRAY_FILTER_USE_BOTH);
}, ARRAY_FILTER_USE_BOTH);
},
'gateway.paymentMethodsEnabledAtMollie' => static function (ContainerInterface $container): array {
$dataHelper = $container->get('settings.data_helper');
Expand Down
11 changes: 6 additions & 5 deletions src/PaymentMethods/AbstractPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Mollie\WooCommerce\PaymentMethods;


use Inpsyde\PaymentGateway\Icon;
use Inpsyde\PaymentGateway\IconProviderInterface;
use Inpsyde\PaymentGateway\Method\CustomSettingsFields;
Expand All @@ -28,6 +27,7 @@
abstract class AbstractPaymentMethod implements PaymentMethodI, PaymentMethodDefinition
{
use DefaultPaymentMethodDefinitionTrait;

/**
* @var string[]
*/
Expand All @@ -44,7 +44,8 @@ abstract class AbstractPaymentMethod implements PaymentMethodI, PaymentMethodDef
*/
protected bool $translationsInitialized = false;

public function __construct() {
public function __construct()
{
$this->config = $this->getConfig();
$this->settings = $this->getSettings();
$this->surcharge = new Surcharge();
Expand Down Expand Up @@ -267,7 +268,7 @@ protected function titleIsDefault(): bool

public function id(): string
{
return 'mollie_wc_gateway_'.$this->getIdFromConfig();
return 'mollie_wc_gateway_' . $this->getIdFromConfig();
}

public function paymentProcessor(ContainerInterface $container): PaymentProcessorInterface
Expand Down Expand Up @@ -344,7 +345,7 @@ public function paymentMethodIconProvider(ContainerInterface $container): IconPr
$url = $iconFactory->getExternalIconHtml($this->apiPaymentMethod["image"]->svg);
}

$alt = $this->getIdFromConfig(). ' icon';
$alt = $this->getIdFromConfig() . ' icon';
$icon = new Icon(
$this->getIdFromConfig(),
$url,
Expand Down Expand Up @@ -425,7 +426,7 @@ public function customSettings(): CustomSettingsFieldsDefinition
return new CustomSettingsFields([
'multi_select_countries' => function () {
return new MultiCountrySettingsField($this);
}
},
], []);
}
}
2 changes: 2 additions & 0 deletions src/PaymentMethods/Alma.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ protected function getConfig(): array
'docs' => 'https://www.mollie.com/gb/payments/alma',
];
}

// Replace translatable strings after the 'after_setup_theme' hook
public function initializeTranslations(): void
{
Expand All @@ -37,6 +38,7 @@ public function initializeTranslations(): void
$this->config['defaultTitle'] = __('Alma', 'mollie-payments-for-woocommerce');
$this->translationsInitialized = true;
}

public function getFormFields($generalFormFields): array
{
return $generalFormFields;
Expand Down
1 change: 1 addition & 0 deletions src/PaymentMethods/Applepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function initializeTranslations(): void
);
$this->translationsInitialized = true;
}

public function getFormFields($generalFormFields): array
{

Expand Down
1 change: 0 additions & 1 deletion src/PaymentMethods/Banktransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public function initializeTranslations(): void
$this->translationsInitialized = true;
}


public function getFormFields($generalFormFields): array
{
unset($generalFormFields['activate_expiry_days_setting']);
Expand Down
1 change: 1 addition & 0 deletions src/PaymentMethods/Belfius.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function initializeTranslations(): void
$this->config['defaultTitle'] = __('Belfius Direct Net', 'mollie-payments-for-woocommerce');
$this->translationsInitialized = true;
}

public function getFormFields($generalFormFields): array
{
return $generalFormFields;
Expand Down
2 changes: 0 additions & 2 deletions src/PaymentMethods/Icon/GatewayIconsRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

class GatewayIconsRenderer implements GatewayIconsRendererInterface
{


private PaymentMethodI $paymentMethod;
private IconProviderInterface $iconProvider;

Expand Down
1 change: 1 addition & 0 deletions src/Shared/GatewaySurchargeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function __construct(Surcharge $surcharge)
add_action('after_setup_theme', [$this, 'initializeGatewayFeeLabel']);
add_action('init', [$this, 'surchargeActions']);
}

public function initializeGatewayFeeLabel()
{
$this->gatewayFeeLabel = $this->surchargeFeeOption();
Expand Down

0 comments on commit 6a00f1b

Please sign in to comment.