Description
This task is a proposal to create the needed PHP API in the MetricsPlatform extension to start working there on the new PHP xLab SDK following the current approach we prepared for the feature code to deal with the experiment enrollment configuration.
We propose the following:
- There will be an $experimentManager->getExperiment( $experimentName ) function to get the enrollment details (the assigned group) for the experiment whose name if passed as parameter as an Experiment object
- The proposed API for the Experiment class is the following:
namespace MediaWiki\Extension\MetricsPlatform\XLab; interface Experiment { /** * Gets the group the current user was assigned by the EESA when they were * enrolled in this experiment. * * @return {string|null} */ public function getAssignedGroup(): mixed; /** * Sends an interaction event associated with this experiment if the EESA * enrolled the current user in this experiment. */ public function send( string action, array interactionData ): void; } }
Acceptance criteria
- MediaWiki\Extension\MetricsPlatform\ExperimentManager has the following new functions:
- ExperimentManager#getExperiment( string $experimentName ): Experiment
- The Experiment class is created with the API described above