Skip to content

Commit 4b45965

Browse files
committed
using const
1 parent 2b29234 commit 4b45965

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Optimizely/Entity/Experiment.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121

2222
class Experiment
2323
{
24+
/**
25+
* @const string String denoting running state of experiment.
26+
*/
27+
const STATUS_RUNNING = 'Running';
28+
29+
/**
30+
* @const string String denoting policy of mutually exclusive group.
31+
*/
32+
const MUTEX_GROUP_POLICY = 'random';
33+
2434
/**
2535
* @var string Experiment ID.
2636
*/
@@ -262,7 +272,7 @@ public function setTrafficAllocation($trafficAllocation)
262272
*/
263273
public function isInMutexGroup()
264274
{
265-
return !is_null($this->_groupPolicy) && $this->_groupPolicy == 'random';
275+
return !is_null($this->_groupPolicy) && $this->_groupPolicy == self::MUTEX_GROUP_POLICY;
266276
}
267277

268278
/**
@@ -272,7 +282,7 @@ public function isInMutexGroup()
272282
*/
273283
public function isExperimentRunning()
274284
{
275-
return !is_null($this->_status) && $this->_status == 'Running';
285+
return !is_null($this->_status) && $this->_status == self::STATUS_RUNNING;
276286
}
277287

278288
/**

0 commit comments

Comments
 (0)