HEX
Server: LiteSpeed
System: Linux premium235.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: beaupptk (733)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/beaupptk/hasnian1.shop/wp-content/plugins/elementor/modules/atomic-widgets/render-context.php
<?php

namespace Elementor\Modules\AtomicWidgets;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Render_Context {
	private static $context_stack = [];

	public static function push( string $key, array $context ): void {
		if ( ! self::get( $key ) ) {
			self::$context_stack[ $key ] = [];
		}

		self::$context_stack[ $key ][] = $context;
	}

	public static function pop( string $key ): void {
		if ( isset( self::$context_stack[ $key ] ) && ! empty( self::$context_stack[ $key ] ) ) {
			array_pop( self::$context_stack[ $key ] );
		}
	}

	public static function get( string $key ): array {
		if ( ! isset( self::$context_stack[ $key ] ) || empty( self::$context_stack[ $key ] ) ) {
			return [];
		}

		$last_key = array_key_last( self::$context_stack[ $key ] );
		return self::$context_stack[ $key ][ $last_key ];
	}

	public static function clear(): void {
		self::$context_stack = [];
	}
}