Skip to content

Commit bc47a63

Browse files
committed
WIP
1 parent 141192d commit bc47a63

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

src/Optimizely/DecisionService/DecisionService.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function getVariation(ProjectConfigInterface $projectConfig, Experiment $
177177
$decideReasons[] = $message;
178178
} else {
179179
if (!in_array(OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE, $decideOptions)) {
180-
$this->saveVariation($experiment, $variation, $userProfile, $decideReasons);
180+
$this->saveVariation($experiment, $variation, $userProfile);
181181
}
182182
$message = sprintf(
183183
'User "%s" is in variation %s of experiment %s.',
@@ -599,7 +599,7 @@ private function getStoredVariation(ProjectConfigInterface $projectConfig, Exper
599599
* @param $variation Variation Variation the user is bucketed into.
600600
* @param $userProfile UserProfile User profile object to which we are persisting the variation assignment.
601601
*/
602-
private function saveVariation(Experiment $experiment, Variation $variation, UserProfile $userProfile, &$decideReasons = [])
602+
private function saveVariation(Experiment $experiment, Variation $variation, UserProfile $userProfile)
603603
{
604604
if (is_null($this->_userProfileService)) {
605605
return;
@@ -627,7 +627,6 @@ private function saveVariation(Experiment $experiment, Variation $variation, Use
627627
);
628628

629629
$this->_logger->log(Logger::INFO, $message);
630-
$decideReasons[] = $message;
631630
} catch (Exception $e) {
632631
$message = sprintf(
633632
'Failed to save variation "%s" of experiment "%s" for user "%s".',
@@ -637,7 +636,6 @@ private function saveVariation(Experiment $experiment, Variation $variation, Use
637636
);
638637

639638
$this->_logger->log(Logger::WARNING, $message);
640-
$decideReasons[] = $message;
641639
}
642640
}
643641
}

src/Optimizely/DecisionService/FeatureDecision.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright 2017, 2019 Optimizely Inc and Contributors
3+
* Copyright 2017, 2019-2020 Optimizely Inc and Contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

src/Optimizely/Enums/DecisionNotificationTypes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
class DecisionNotificationTypes
2121
{
2222
const AB_TEST = "ab-test";
23+
const ALL_FEATURE_VARIABLES = "all-feature-variables";
2324
const FEATURE = "feature";
2425
const FEATURE_TEST = "feature-test";
2526
const FEATURE_VARIABLE = "feature-variable";
2627
const FLAG = "flag";
27-
const ALL_FEATURE_VARIABLES = "all-feature-variables";
2828
}

src/Optimizely/Optimizely.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected function sendImpressionEvent($config, $experimentKey, $variationKey, $
253253

254254
public function createUserContext($userId, array $userAttributes = [])
255255
{
256-
// We do not check if config is ready as UserContext can be created evne when SDK is not ready.
256+
// We do not check if config is ready as UserContext can be created even when SDK is not ready.
257257

258258
// validate userId
259259
if (!$this->validateInputs(

tests/OptimizelyTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*/
1717
namespace Optimizely\Tests;
1818

19-
// require(dirname(__FILE__).'/TestData.php');
20-
2119
use Exception;
2220
use GuzzleHttp\Client;
2321
use GuzzleHttp\Handler\MockHandler;

tests/OptimizelyUserContextTests.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
require(dirname(__FILE__).'/TestData.php');
2020

21-
2221
use Exception;
2322
use TypeError;
2423

@@ -29,8 +28,6 @@
2928

3029
class OptimizelyUserContextTest extends \PHPUnit_Framework_TestCase
3130
{
32-
const OUTPUT_STREAM = 'output';
33-
3431
private $datafile;
3532
private $loggerMock;
3633
private $optimizelyObject;

0 commit comments

Comments
 (0)