示例#1
0
 /**
  * Adds the experiment related to the currently requested post to the setup.
  *
  * @param NelioABPostAlternativeExperiment $exp       The experiment that tests the currently requested post.
  * @param int                              $alt_index The alternative (of `$exp`) this visitor is supposed to see.
  *
  * @since 4.0.0
  */
 private static function completeEnvironment($exp, $alt_index)
 {
     switch ($exp->get_type()) {
         case NelioABExperiment::PAGE_ALT_EXP:
         case NelioABExperiment::POST_ALT_EXP:
         case NelioABExperiment::CPT_ALT_EXP:
             self::add_regular_exp($exp, $alt_index);
             array_push(self::$ids, $exp->get_id());
             break;
         case NelioABExperiment::HEADLINE_ALT_EXP:
             /** @var NelioABHeadlineAlternativeExperiment $exp */
             self::add_headline_exp($exp, $alt_index);
             array_push(self::$ids, $exp->get_id());
             break;
         case NelioABExperiment::WC_PRODUCT_SUMMARY_ALT_EXP:
             /** @var NelioABHeadlineAlternativeExperiment $exp */
             self::add_wc_product_summary_exp($exp, $alt_index);
             array_push(self::$ids, $exp->get_id());
             break;
     }
 }