Fix the CS

This commit is contained in:
Narek Zakarian 2025-03-05 19:24:33 +04:00
parent ed5077347e
commit 49a5f855b0
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
2 changed files with 5 additions and 5 deletions

View file

@ -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';

View file

@ -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';
}