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

namespace Automattic\WooCommerce\GoogleListingsAndAds\Value;

use Automattic\WooCommerce\GoogleListingsAndAds\Exception\InvalidValue;

defined( 'ABSPATH' ) || exit;

/**
 * Class Notification Status defining statues related to Partner Notifications
 *
 * @package Automattic\WooCommerce\GoogleListingsAndAds\Value
 */
class NotificationStatus implements ValueInterface {

	public const NOTIFICATION_PENDING_CREATE = 'pending_create';
	public const NOTIFICATION_PENDING_UPDATE = 'pending_update';
	public const NOTIFICATION_PENDING_DELETE = 'pending_delete';
	public const NOTIFICATION_CREATED        = 'created';
	public const NOTIFICATION_UPDATED        = 'updated';
	public const NOTIFICATION_DELETED        = 'deleted';

	public const ALLOWED_VALUES = [
		self::NOTIFICATION_PENDING_CREATE,
		self::NOTIFICATION_PENDING_UPDATE,
		self::NOTIFICATION_PENDING_DELETE,
		self::NOTIFICATION_CREATED,
		self::NOTIFICATION_DELETED,
		self::NOTIFICATION_UPDATED,
	];

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

	/**
	 * NotificationStatus 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();
	}
}