Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /home/claqxcrl/anfangola.com/wp-content/plugins/wp-smushit/core/parser/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/claqxcrl/anfangola.com/wp-content/plugins/wp-smushit/core/parser/class-composite-element.php
<?php

namespace Smush\Core\Parser;

class Composite_Element {
	/**
	 * @var string
	 */
	private $markup;
	/**
	 * @var string
	 */
	private $tag;
	/**
	 * @var Element[]
	 */
	private $elements;

	public function __construct( $markup, $tag, $elements ) {
		$this->markup   = $markup;
		$this->tag      = $tag;
		$this->elements = $elements;
	}

	/**
	 * @return string
	 */
	public function get_markup(): string {
		return $this->markup;
	}

	/**
	 * @return string
	 */
	public function get_tag(): string {
		return $this->tag;
	}

	/**
	 * @return Element[]
	 */
	public function get_elements(): array {
		return $this->elements;
	}

	public function has_updates() {
		foreach ( $this->elements as $element ) {
			if ( $element->has_updates() ) {
				return true;
			}
		}
		return false;
	}

	public function get_updated() {
		$updated = $this->markup;
		foreach ( $this->elements as $element ) {
			if ( $element->has_updates() ) {
				$updated = str_replace(
					$element->get_markup(),
					$element->get_updated_markup(),
					$updated
				);
			}
		}

		return $updated;
	}
}

ZeroDay Forums Mini