From 0761cb019b0efedbcdf4da2f19be4c54a3d1c4b5 Mon Sep 17 00:00:00 2001 From: mikkamp Date: Mon, 2 Dec 2024 14:04:08 +0000 Subject: [PATCH] Include extension name in fallback messages --- src/Exception/ExtensionRequirementException.php | 4 ++-- src/Exception/InvalidVersion.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Exception/ExtensionRequirementException.php b/src/Exception/ExtensionRequirementException.php index 28e693eebf..d9b00fec8a 100644 --- a/src/Exception/ExtensionRequirementException.php +++ b/src/Exception/ExtensionRequirementException.php @@ -26,7 +26,7 @@ class ExtensionRequirementException extends RuntimeExceptionWithMessageFunction public static function missing_required_plugin( string $plugin_name ): ExtensionRequirementException { return new static( sprintf( - 'Requires %1$s to be enabled.', // Fallback exception message. + 'Google for WooCommerce requires %1$s to be enabled.', // Fallback exception message. $plugin_name ), 0, @@ -49,7 +49,7 @@ public static function missing_required_plugin( string $plugin_name ): Extension public static function incompatible_plugin( string $plugin_name ): ExtensionRequirementException { return new static( sprintf( - 'Incompatible with %1$s.', // Fallback exception message. + 'Google for WooCommerce is incompatible with %1$s.', // Fallback exception message. $plugin_name ), 0, diff --git a/src/Exception/InvalidVersion.php b/src/Exception/InvalidVersion.php index 8c17cc32e3..6fc6106ed8 100644 --- a/src/Exception/InvalidVersion.php +++ b/src/Exception/InvalidVersion.php @@ -28,7 +28,7 @@ class InvalidVersion extends RuntimeExceptionWithMessageFunction implements Goog public static function from_requirement( string $requirement, string $found_version, string $minimum_version ): InvalidVersion { return new static( sprintf( - 'Requires %1$s version %2$s or higher. You are using version %3$s.', // Fallback exception message. + 'Google for WooCommerce requires %1$s version %2$s or higher. You are using version %3$s.', // Fallback exception message. $requirement, $minimum_version, $found_version @@ -56,7 +56,7 @@ public static function from_requirement( string $requirement, string $found_vers public static function requirement_missing( string $requirement, string $minimum_version ): InvalidVersion { return new static( sprintf( - 'Requires %1$s version %2$s or higher.', // Fallback exception message. + 'Google for WooCommerce requires %1$s version %2$s or higher.', // Fallback exception message. $requirement, $minimum_version ), @@ -79,7 +79,7 @@ public static function requirement_missing( string $requirement, string $minimum */ public static function invalid_architecture(): InvalidVersion { return new static( - 'Requires a 64 bit version of PHP.', // Fallback exception message. + 'Google for WooCommerce requires a 64 bit version of PHP.', // Fallback exception message. 0, null, fn () => __( 'Google for WooCommerce requires a 64 bit version of PHP.', 'google-listings-and-ads' )