NOXSHELL
Server: Apache
System: Linux p3plzcpnl504199.prod.phx3.secureserver.net 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User: zew5vtsbg2ra (9542639)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/zew5vtsbg2ra/public_html/wp-content/plugins/elementor/modules/atomic-widgets/utils/memo.php
<?php

namespace Elementor\Modules\AtomicWidgets\Utils;

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

class Memo {
	private array $cache = [];

	public function memoize( string $key, callable $callback ) {
		return function() use ( $key, $callback ) {
			if ( array_key_exists( $key, $this->cache ) ) {
				return $this->cache[ $key ];
			}

			$this->cache[ $key ] = call_user_func( $callback );
			return $this->cache[ $key ];
		};
	}
}