HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/kadence-blocks/includes/resources/Optimizer/Enums/Viewport.php
<?php declare( strict_types=1 );

namespace KadenceWP\KadenceBlocks\Optimizer\Enums;

/**
 * A pseudo Viewport enum.
 */
final class Viewport {

	public const DESKTOP = 'desktop';
	public const MOBILE  = 'mobile';

	/**
	 * The view port.
	 *
	 * @var string
	 */
	private string $value;

	private function __construct( string $value ) {
		$this->value = $value;
	}

	public static function desktop(): self {
		return new self( self::DESKTOP );
	}

	public static function mobile(): self {
		return new self( self::MOBILE );
	}

	public static function current( bool $is_mobile ): self {
		return $is_mobile ? self::mobile() : self::desktop();
	}

	public function value(): string {
		return $this->value;
	}

	public function equals( self $other ): bool {
		return $this->value === $other->value;
	}

	public function __toString(): string {
		return $this->value;
	}
}