mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🗑️ Deprecate current_environment_is()
This commit is contained in:
parent
81ca5dd00e
commit
aa0a8d4182
1 changed files with 5 additions and 2 deletions
|
@ -56,6 +56,9 @@ class Environment {
|
|||
/**
|
||||
* Detect whether the current environment equals $environment
|
||||
*
|
||||
* @deprecated Use the is_sandbox() and is_production() methods instead.
|
||||
* These methods provide better encapsulation, are less error-prone,
|
||||
* and improve code readability by removing the need to pass environment constants.
|
||||
* @param string $environment The value to check against.
|
||||
*
|
||||
* @return bool
|
||||
|
@ -70,7 +73,7 @@ class Environment {
|
|||
* @return bool
|
||||
*/
|
||||
public function is_sandbox() : bool {
|
||||
return $this->current_environment_is( self::SANDBOX );
|
||||
return $this->current_environment() === self::SANDBOX;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,6 +82,6 @@ class Environment {
|
|||
* @return bool
|
||||
*/
|
||||
public function is_production() : bool {
|
||||
return $this->current_environment_is( self::PRODUCTION );
|
||||
return $this->current_environment() === self::PRODUCTION;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue