HEX
Server: Apache
System: Linux 4801f1b1.ptr.provps.com 6.17.8-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 13 18:02:25 EST 2025 x86_64
User: nassaugo (1004)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/nassaugo/public_html/wp-content/plugins/imunify-security/inc/App/Model/FeatureStatus.php
<?php
/**
 * Copyright (с) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2025 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * https://www.cloudlinux.com/legal/
 */

namespace CloudLinux\Imunify\App\Model;

/**
 * Feature status enum-like class.
 */
class FeatureStatus {
	/**
	 * Feature is enabled.
	 *
	 * @var string
	 */
	const ENABLED = 'ENABLED';

	/**
	 * Feature is disabled.
	 *
	 * @var string
	 */
	const DISABLED = 'DISABLED';

	/**
	 * Get all possible status values.
	 *
	 * @return array<string>
	 */
	public static function getAll() {
		return array(
			self::ENABLED,
			self::DISABLED,
		);
	}

	/**
	 * Check if a status value is valid.
	 *
	 * @param string $status Status to check.
	 *
	 * @return bool
	 */
	public static function isValid( $status ) {
		return in_array( $status, self::getAll(), true );
	}

	/**
	 * Get the default status.
	 *
	 * @return string
	 */
	public static function getDefault() {
		return self::DISABLED;
	}

	/**
	 * Get the translated label for a status value.
	 *
	 * @param string $status Status value.
	 *
	 * @return string
	 */
	public static function getLabel( $status ) {
		switch ( $status ) {
			case self::ENABLED:
				return esc_html__( 'Enabled', 'imunify-security' );
			case self::DISABLED:
				return esc_html__( 'Disabled', 'imunify-security' );
			default:
				return '';
		}
	}
}