Support Environment object in EnvironmentConfig

This commit is contained in:
Philipp Stracker 2025-02-03 13:38:12 +01:00
parent 2c35059e4b
commit d6310f3082
No known key found for this signature in database

View file

@ -70,10 +70,14 @@ class EnvironmentConfig {
/**
* Get the value for the specified environment.
*
* @param bool $for_sandbox Whether to get the sandbox value.
* @param bool|Environment $for_sandbox Whether to get the sandbox value.
* @return T The value for the specified environment.
*/
public function get_value( bool $for_sandbox = false ) {
public function get_value( $for_sandbox = false ) {
if ( $for_sandbox instanceof Environment ) {
return $for_sandbox->is_sandbox() ? $this->sandbox_value : $this->production_value;
}
return $for_sandbox ? $this->sandbox_value : $this->production_value;
}
}