HEX
Server: Apache
System: Linux b5.s-host.com.ua 4.18.0-305.10.2.el7.x86_64 #1 SMP Fri Jul 23 21:00:55 UTC 2021 x86_64
User: unelbhzm (1470)
PHP: 8.0.18
Disabled: NONE
Upload Files
File: /sites/nuofama.com/wp-content/plugins/google-site-kit/includes/Core/Util/Build_Mode.php
<?php
/**
 * Class Google\Site_Kit\Core\Util\Build_Mode
 *
 * @package   Google\Site_Kit\Core\Util
 * @copyright 2021 Google LLC
 * @license   https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
 * @link      https://sitekit.withgoogle.com
 */

namespace Google\Site_Kit\Core\Util;

/**
 * Class for interacting with build mode configuration.
 *
 * @since 1.27.0
 * @access private
 * @ignore
 */
class Build_Mode {

	const MODE_PRODUCTION  = 'production';
	const MODE_DEVELOPMENT = 'development';

	/**
	 * Build mode.
	 *
	 * @since 1.27.0
	 * @var string
	 */
	private static $mode = self::MODE_PRODUCTION;

	/**
	 * Sets the build mode.
	 *
	 * @since 1.27.0
	 *
	 * @param string $mode Build mode.
	 */
	public static function set_mode( $mode ) {
		if ( $mode && is_string( $mode ) ) {
			static::$mode = $mode;
		}
	}

	/**
	 * Gets the current build mode.
	 *
	 * @since 1.27.0
	 *
	 * @return string Current mode.
	 */
	public static function get_mode() {
		/**
		 * Filter the build mode.
		 *
		 * @since 1.27.0
		 *
		 * @param string $mode The current build mode.
		 */
		return (string) apply_filters( 'googlesitekit_build_mode', static::$mode ) ?: self::MODE_PRODUCTION;
	}

}