first commit

This commit is contained in:
Roman Pyrih
2026-03-10 09:50:10 +01:00
commit 64c4a90405
7289 changed files with 2645777 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?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 ];
};
}
}