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/SyncStatus.php.tar
uyarreklam.com.tr/httpdocs/wp-content/plugins/google-listings-and-ads/src/Value/SyncStatus.php000064400000002343151551761040031531 0ustar00var/www/vhosts<?php
declare( strict_types=1 );

namespace Automattic\WooCommerce\GoogleListingsAndAds\Value;

use Automattic\WooCommerce\GoogleListingsAndAds\Exception\InvalidValue;

defined( 'ABSPATH' ) || exit;

/**
 * Class SyncStatus
 *
 * @package Automattic\WooCommerce\GoogleListingsAndAds\Value
 */
class SyncStatus implements ValueInterface {

	public const SYNCED     = 'synced';
	public const NOT_SYNCED = 'not-synced';
	public const HAS_ERRORS = 'has-errors';
	public const PENDING    = 'pending';

	public const ALLOWED_VALUES = [
		self::SYNCED,
		self::PENDING,
		self::HAS_ERRORS,
		self::NOT_SYNCED,
	];

	/**
	 * @var string
	 */
	protected $status;

	/**
	 * SyncStatus constructor.
	 *
	 * @param string $status The value.
	 *
	 * @throws InvalidValue When an invalid status type is provided.
	 */
	public function __construct( string $status ) {
		if ( ! in_array( $status, self::ALLOWED_VALUES, true ) ) {
			throw InvalidValue::not_in_allowed_list( $status, self::ALLOWED_VALUES );
		}

		$this->status = $status;
	}

	/**
	 * Get the value of the object.
	 *
	 * @return string
	 */
	public function get(): string {
		return $this->status;
	}

	/**
	 * @return string
	 */
	public function __toString(): string {
		return $this->get();
	}
}