diff --git a/src/FeatureSwitch/Feature/Switcher/AB.php b/src/FeatureSwitch/Feature/Switcher/AB.php index 944fcaf..f9e264d 100644 --- a/src/FeatureSwitch/Feature/Switcher/AB.php +++ b/src/FeatureSwitch/Feature/Switcher/AB.php @@ -29,7 +29,7 @@ public function isEnabled(FeatureInterface $feature) $cookieResult = $this->getRandomState(); $cookieWrapper->set($featureCookieKey, $cookieResult, self::EXPIRE); } - return $cookieResult; + return filter_var($cookieResult, FILTER_VALIDATE_BOOLEAN); } /** @@ -39,7 +39,8 @@ protected function getRandomState() { $state = $this->lastState === null ? $this->getRandomStateByMicroTime() : !$this->lastState; $this->lastState = $state; - return $state; + + return $state ? 'TRUE' : 'FALSE'; }