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

namespace Automattic\WooCommerce\GoogleListingsAndAds\Internal;

defined( 'ABSPATH' ) || exit;

/**
 * Class for mapping between a status number and a status label.
 *
 * @package Automattic\WooCommerce\GoogleListingsAndAds\Internal
 */
abstract class StatusMapping {

	/**
	 * Return the status as a label.
	 *
	 * @param int $number Status number.
	 *
	 * @return string
	 */
	public static function label( int $number ): string {
		return isset( static::MAPPING[ $number ] ) ? static::MAPPING[ $number ] : '';
	}

	/**
	 * Return the status as a number.
	 *
	 * @param string $label Status label.
	 *
	 * @return int
	 */
	public static function number( string $label ): int {
		$key = array_search( $label, static::MAPPING, true );
		return $key === false ? 0 : $key;
	}

	/**
	 * Return all the status labels.
	 *
	 * @return array
	 */
	public static function labels(): array {
		return array_values( static::MAPPING );
	}
}