HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/BooleanSelect.php.tar
httpdocs/wp-content/plugins/google-listings-and-ads/src/Admin/Input/BooleanSelect.php000064400000001466151550501070033202 0ustar00var/www/vhosts/uyarreklam.com.tr<?php
declare( strict_types=1 );

namespace Automattic\WooCommerce\GoogleListingsAndAds\Admin\Input;

defined( 'ABSPATH' ) || exit;

/**
 * Class BooleanSelect
 *
 * @package Automattic\WooCommerce\GoogleListingsAndAds\Admin\Input
 */
class BooleanSelect extends Select {

	/**
	 * @return array
	 */
	public function get_options(): array {
		return [
			''    => __( 'Default', 'google-listings-and-ads' ),
			'yes' => __( 'Yes', 'google-listings-and-ads' ),
			'no'  => __( 'No', 'google-listings-and-ads' ),
		];
	}

	/**
	 * Return the data used for the input's view.
	 *
	 * @return array
	 */
	public function get_view_data(): array {
		$view_data = parent::get_view_data();

		if ( is_bool( $view_data['value'] ) ) {
			$view_data['value'] = wc_bool_to_string( $view_data['value'] );
		}

		return $view_data;
	}
}