mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Fix the CS
This commit is contained in:
parent
ed5077347e
commit
49a5f855b0
2 changed files with 5 additions and 5 deletions
|
@ -38,7 +38,7 @@ class PaymentMethodSettingsMapHelper {
|
|||
* @param string $old_key The key from the legacy settings.
|
||||
* @return mixed The value of the mapped setting, (null if not found).
|
||||
*/
|
||||
public function mapped_value( string $old_key): ?bool {
|
||||
public function mapped_value( string $old_key ): ?bool {
|
||||
|
||||
$payment_method = $this->map()[ $old_key ] ?? false;
|
||||
|
||||
|
@ -56,7 +56,7 @@ class PaymentMethodSettingsMapHelper {
|
|||
* @return bool True if the payment gateway with the given name is enabled, otherwise false.
|
||||
*/
|
||||
protected function is_gateway_enabled( string $gateway_name ): bool {
|
||||
$gateway_settings = get_option( "woocommerce_{$gateway_name}_settings", [] );
|
||||
$gateway_settings = get_option( "woocommerce_{$gateway_name}_settings", array() );
|
||||
$gateway_enabled = $gateway_settings['enabled'] ?? false;
|
||||
|
||||
return $gateway_enabled === 'yes';
|
||||
|
|
|
@ -262,7 +262,7 @@ class StylingSettingsMapHelper {
|
|||
* @return int The enabled (1) or disabled (0) state.
|
||||
* @throws RuntimeException If an invalid button name is provided.
|
||||
*/
|
||||
protected function mapped_button_enabled_value( array $styling_models, string $button_name): ?int {
|
||||
protected function mapped_button_enabled_value( array $styling_models, string $button_name ): ?int {
|
||||
if ( ! in_array( $button_name, self::BUTTON_NAMES, true ) ) {
|
||||
throw new RuntimeException( 'Wrong button name is provided.' );
|
||||
}
|
||||
|
@ -309,8 +309,8 @@ class StylingSettingsMapHelper {
|
|||
* @return bool True if the payment gateway with the given name is enabled, otherwise false.
|
||||
*/
|
||||
protected function is_gateway_enabled( string $gateway_name ): bool {
|
||||
$gateway_settings = get_option( "woocommerce_{$gateway_name}_settings", [] );
|
||||
$gateway_enabled = $gateway_settings['enabled'] ?? false;
|
||||
$gateway_settings = get_option( "woocommerce_{$gateway_name}_settings", array() );
|
||||
$gateway_enabled = $gateway_settings['enabled'] ?? false;
|
||||
|
||||
return $gateway_enabled === 'yes';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue