Skip to content

Commit

Permalink
function deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
ozayr-zaviar committed Aug 25, 2021
1 parent 930400f commit db3b3fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Optimizely/OptimizelyConfig/OptimizelyFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,16 @@ public function getDeliveryRules()
}

/**
* @deprecated
*
* @return array Map of Experiment Keys to OptimizelyExperiments.
*/
public function getExperimentsMap()
{
# This experimentsMap is deprecated. Use experimentRules and deliveryRules instead.

trigger_error('Method ' . __METHOD__ . ' is deprecated. Use experimentRules and deliveryRules instead.', E_USER_NOTICE);

return $this->experimentsMap;
}

Expand Down
4 changes: 3 additions & 1 deletion tests/OptimizelyConfigTests/OptimizelyEntitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public function testOptimizelyFeatureEntity()

$this->assertEquals("id", $optFeature->getId());
$this->assertEquals("key", $optFeature->getKey());
$this->assertEquals(["a" => "apple"], $optFeature->getExperimentsMap());

# getExperimentsMap is deprecated
# $this->assertEquals(["a" => "apple"], $optFeature->getExperimentsMap());
$this->assertEquals(["o" => "orange"], $optFeature->getVariablesMap());
$this->assertEquals([], $optFeature->getExperimentRules());
$this->assertEquals([], $optFeature->getDeliveryRules());
Expand Down

0 comments on commit db3b3fe

Please sign in to comment.