| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\Utils; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; // Exit if accessed directly. |
| 7 |
} |
| 8 |
|
| 9 |
class Atomic_Prop_Remap_Registry { |
| 10 |
/** |
| 11 |
* @var array<string, callable> |
| 12 |
*/ |
| 13 |
private static array $handlers = []; |
| 14 |
|
| 15 |
public static function register( string $type, callable $handler ): void { |
| 16 |
self::$handlers[ $type ] = $handler; |
| 17 |
} |
| 18 |
|
| 19 |
public static function get( string $type ): ?callable { |
| 20 |
return self::$handlers[ $type ] ?? null; |
| 21 |
} |
| 22 |
|
| 23 |
public static function has( string $type ): bool { |
| 24 |
return isset( self::$handlers[ $type ] ); |
| 25 |
} |
| 26 |
|
| 27 |
public static function reset(): void { |
| 28 |
self::$handlers = []; |
| 29 |
} |
| 30 |
} |
| 31 |
|