Skip to content

Commit

Permalink
Include extension name in fallback messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkamp committed Dec 2, 2024
1 parent ac388bb commit 0761cb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Exception/ExtensionRequirementException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/Exception/InvalidVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
),
Expand All @@ -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' )

Check warning on line 85 in src/Exception/InvalidVersion.php

View check run for this annotation

Codecov / codecov/patch

src/Exception/InvalidVersion.php#L82-L85

Added lines #L82 - L85 were not covered by tests
Expand Down

0 comments on commit 0761cb0

Please sign in to comment.