From 0aa780566256eede36d1e58da4de682aef32b6f8 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Tue, 1 Oct 2024 14:14:30 +0200 Subject: [PATCH] Cast the flags to bool --- src/Gateway/GatewayModule.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 84da8ccd..72cade0d 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -106,25 +106,25 @@ public function services(): array }, 'gateway.getPaymentMethodsAfterFeatureFlag' => static function (ContainerInterface $container): array { $availablePaymentMethods = $container->get('gateway.listAllMethodsAvailable'); - $klarnaOneFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.klarna_one_enabled', true); + $klarnaOneFlag = (bool) apply_filters('inpsyde.feature-flags.mollie-woocommerce.klarna_one_enabled', true); if (!$klarnaOneFlag) { $availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) { return $method['id'] !== Constants::KLARNA; }); } - $bancomatpayFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.bancomatpay_enabled', true); + $bancomatpayFlag = (bool) apply_filters('inpsyde.feature-flags.mollie-woocommerce.bancomatpay_enabled', true); if (!$bancomatpayFlag) { $availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) { return $method['id'] !== Constants::BANCOMATPAY; }); } - $almaFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', true); + $almaFlag = (bool) apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', true); if (!$almaFlag) { $availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) { return $method['id'] !== Constants::ALMA; }); } - $swishFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.swish_enabled', false); + $swishFlag = (bool) apply_filters('inpsyde.feature-flags.mollie-woocommerce.swish_enabled', false); if (!$swishFlag) { $availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) { return $method['id'] !== Constants::SWISH;