Skip to content

Commit 2c3c99e

Browse files
committed
Setting default values correctly
1 parent 8a9bd18 commit 2c3c99e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Optimizely/ProjectConfig.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ public function __construct($datafile, $logger, $errorHandler)
129129
$this->_projectId = $config['projectId'];
130130
$this->_revision = $config['revision'];
131131

132-
$groups = $config['groups'];
133-
$experiments = $config['experiments'];
134-
$events = $config['events'];
135-
$attributes = $config['attributes'];
136-
$audiences = $config['audiences'];
132+
$groups = $config['groups'] ?: [];
133+
$experiments = $config['experiments'] ?: [];
134+
$events = $config['events'] ?: [];
135+
$attributes = $config['attributes'] ?: [];
136+
$audiences = $config['audiences'] ?: [];
137137

138138
$this->_groupIdMap = ConfigParser::generateMap($groups, 'id', Group::class);
139139
$this->_experimentKeyMap = ConfigParser::generateMap($experiments, 'key', Experiment::class);

0 commit comments

Comments
 (0)