public function getForcedVariation($experimentKey, $userId)
    {
        if (!$this->validateInputs(
            [
                self::EXPERIMENT_KEY =>$experimentKey,
                self::USER_ID => $userId
            ]
        )) {
            return null;
        }

        $forcedVariation = $this->_config->getForcedVariation($experimentKey, $userId);
        if (isset($forcedVariation)) {
            return $forcedVariation->getKey();
        } else {
            return null;
        }
    }
public function getForcedVariation($experimentKey, $userId)
    {
        if (!$this->validateInputs(
            [
                self::EXPERIMENT_KEY =>$experimentKey,
                self::USER_ID => $userId
            ]
        )) {
            return null;
        }

        $forcedVariation = $this->_config->getForcedVariation($experimentKey, $userId);
        if (isset($forcedVariation)) {
            return $forcedVariation->getKey();
        } else {
            return null;
        }
    }
public function getForcedVariation ( $ experimentKey , $ userId ) { if ( ! $ this -> validateInputs ( [ self :: EXPERIMENT_KEY => $ experimentKey , self :: USER_ID => $ userId ] ) ) { return null ; } $ forcedVariation = $ this -> _config -> getForcedVariation ( $ experimentKey , $ userId ) ; if ( isset ( $ forcedVariation ) ) { return $ forcedVariation -> getKey ( ) ; } else { return null ; } }
Gets the forced variation for a given user and experiment.

@param $experimentKey string Key identifying the experiment.
@param $userId string The user ID to be used for bucketing.

@return string|null The forced variation key.
Gets the forced variation for a given user and experiment .