| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\CssConverter; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; // Exit if accessed directly. |
| 7 |
} |
| 8 |
|
| 9 |
class Converter_Registry { |
| 10 |
/** |
| 11 |
* @var Property_Converter[] |
| 12 |
*/ |
| 13 |
private array $converters = []; |
| 14 |
|
| 15 |
public function register( Property_Converter $converter ): self { |
| 16 |
$this->converters[] = $converter; |
| 17 |
|
| 18 |
return $this; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Converters in registration order. The dispatcher iterates these and applies |
| 23 |
* the try-until-success flow (is_supported -> convert -> fallthrough on failure). |
| 24 |
* |
| 25 |
* @return Property_Converter[] |
| 26 |
*/ |
| 27 |
public function all(): array { |
| 28 |
return $this->converters; |
| 29 |
} |
| 30 |
} |
| 31 |
|