| 1 |
<?php |
| 2 |
/** |
| 3 |
* Experiment interface. |
| 4 |
* |
| 5 |
* @package WordPress\AI\Contracts |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace WordPress\AI\Contracts; |
| 11 |
|
| 12 |
/** |
| 13 |
* Interface for all experiments. |
| 14 |
* |
| 15 |
* Every experiment must implement this interface to be registered in the system. |
| 16 |
* |
| 17 |
* @since 0.1.0 |
| 18 |
*/ |
| 19 |
interface Experiment { |
| 20 |
/** |
| 21 |
* Gets the unique experiment identifier. |
| 22 |
* |
| 23 |
* This should be a unique slug-style identifier (e.g., 'title-rewriter'). |
| 24 |
* |
| 25 |
* @since 0.1.0 |
| 26 |
* |
| 27 |
* @return string Experiment ID. |
| 28 |
*/ |
| 29 |
public function get_id(): string; |
| 30 |
|
| 31 |
/** |
| 32 |
* Gets the human-readable experiment label. |
| 33 |
* |
| 34 |
* This should be a translated string suitable for display in the admin. |
| 35 |
* |
| 36 |
* @since 0.1.0 |
| 37 |
* |
| 38 |
* @return string Translated experiment label. |
| 39 |
*/ |
| 40 |
public function get_label(): string; |
| 41 |
|
| 42 |
/** |
| 43 |
* Gets the experiment description. |
| 44 |
* |
| 45 |
* This should be a translated string explaining what the experiment does. |
| 46 |
* |
| 47 |
* @since 0.1.0 |
| 48 |
* |
| 49 |
* @return string Translated experiment description. |
| 50 |
*/ |
| 51 |
public function get_description(): string; |
| 52 |
|
| 53 |
/** |
| 54 |
* Registers the experiment's hooks and functionality. |
| 55 |
* |
| 56 |
* This method is called when the experiment is initialized. |
| 57 |
* Use this to add actions, filters, and set up the experiment. |
| 58 |
* |
| 59 |
* @since 0.1.0 |
| 60 |
*/ |
| 61 |
public function register(): void; |
| 62 |
|
| 63 |
/** |
| 64 |
* Checks if the experiment is currently enabled. |
| 65 |
* |
| 66 |
* @since 0.1.0 |
| 67 |
* |
| 68 |
* @return bool True if enabled, false otherwise. |
| 69 |
*/ |
| 70 |
public function is_enabled(): bool; |
| 71 |
} |
| 72 |
|