From d1adbf7b468500e9d46f301ea8449a8618666559 Mon Sep 17 00:00:00 2001 From: Philipp Stracker Date: Fri, 21 Mar 2025 17:23:02 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Use=20the=20enum=20in=20th?= =?UTF-8?q?e=20ActivationDetector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BrandedExperience/ActivationDetector.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/ppcp-settings/src/Service/BrandedExperience/ActivationDetector.php b/modules/ppcp-settings/src/Service/BrandedExperience/ActivationDetector.php index a4e03fb45..48c38e91d 100644 --- a/modules/ppcp-settings/src/Service/BrandedExperience/ActivationDetector.php +++ b/modules/ppcp-settings/src/Service/BrandedExperience/ActivationDetector.php @@ -9,14 +9,12 @@ declare( strict_types = 1 ); namespace WooCommerce\PayPalCommerce\Settings\Service\BrandedExperience; +use WooCommerce\PayPalCommerce\Settings\Enum\InstallationPathEnum; + /** * Class that includes detection logic for Branded Experience. */ class ActivationDetector { - public const CORE_PROFILER = 'core-profiler'; - public const PAYMENT_SETTINGS = 'payment-settings'; - public const DIRECT = 'direct'; - /** * Detects from which path the plugin was installed. * @@ -28,15 +26,15 @@ class ActivationDetector { $onboarding_data = (array) get_option( 'woocommerce_onboarding_profile', array() ); if ( ! empty( $onboarding_data['business_extensions'] ) && is_array( $onboarding_data['business_extensions'] ) && in_array( $slug, $onboarding_data['business_extensions'], true ) ) { - return self::CORE_PROFILER; + return InstallationPathEnum::CORE_PROFILER; } $nox_data = (array) get_option( 'woocommerce_payments_nox_profile', array() ); if ( ! empty( $nox_data['extensions']['attached'] ) && is_array( $nox_data['extensions']['attached'] ) && in_array( $slug, array_column( $nox_data['extensions']['attached'], 'slug' ), true ) ) { - return self::PAYMENT_SETTINGS; + return InstallationPathEnum::PAYMENT_SETTINGS; } - return self::DIRECT; + return InstallationPathEnum::DIRECT; } }