HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/wp-smushit/core/parser/class-value.php
<?php

namespace Smush\Core\Parser;

class Value {
	private $previous_value;

	private $value;

	private $has_updates = false;

	public function __construct( $value ) {
		$this->previous_value = '';
		$this->value          = $value;
	}

	/**
	 * @param $value
	 *
	 * @return bool
	 */
	public function set( $value ) {
		if ( $value === $this->value ) {
			/**
			 * Don't do anything if the value hasn't changed.
			 * We don't want to do unnecessary string replacements.
			 */
			return false;
		}

		$this->previous_value = $this->value;
		$this->value          = $value;
		$this->has_updates    = true;
		return true;
	}

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

	public function get_previous() {
		return $this->previous_value;
	}

	public function has_updates() {
		return $this->has_updates;
	}
}