Allow the Scientist library to be used with Symfony.
Require the latest version of Scientist Symfony using Composer.
composer require danhanly/scientist-symfony
Register the bundle in your AppKernel.
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
...
new DanHanly\ScientistBundle\ScientistBundle()
];
...
}
}
You can access Scientist from any Container Aware Class.
$scientist = $this->container->get('scientist');
From this point, you can use the library as normal within your processes.
$scientist->experiment('my experiment')
->control($controlCallback)
->trial('trial name', $trialCallback);
$value = $experiment->run();