Namshi\AB\Test::getVariation PHP Method

getVariation() public method

You must run the test before getting the variation, else a BadMethodCallException is thrown. If the test is disabled, the first variation will always be returned, even if its odd is set to 0.
public getVariation ( ) : string
return string
    public function getVariation()
    {
        if (!$this->hasRun()) {
            $this->run();
        }
        if ($this->isDisabled()) {
            $variations = array_keys($this->getVariations());
            return array_shift($variations);
        }
        return $this->variation;
    }