Code Duplication    Length = 7-8 lines in 3 locations

lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Action.php 1 location

@@ 42-48 (lines=7) @@
39
    {
40
        foreach ($options as $name=>$value) {
41
            switch ($name) {                
42
                case 'changes': {
43
                    $changes = array();
44
                    foreach ($value as $changeInfo) {
45
                        $changes[] = new Change($changeInfo);
46
                    }
47
                    $this->setChanges($changes); break;
48
                }
49
                case 'page_id': $this->setPageId($value); break;
50
                case 'share_link': $this->setShareLink($value); break;
51
                default:

lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Campaign.php 1 location

@@ 117-123 (lines=7) @@
114
        foreach ($options as $name=>$value) {
115
            switch ($name) {                
116
                case 'project_id': $this->setProjectId($value); break;
117
                case 'changes': {
118
                    $changes = array();
119
                    foreach ($value as $changeInfo) {
120
                        $changes[] = new Change($changeInfo);
121
                    }
122
                    $this->setChanges($changes); break;
123
                }
124
                case 'created': $this->setCreated($value); break;
125
                case 'earliest': $this->setEarliest($value); break;
126
                case 'experiment_ids': $this->setExperimentIds($value); break;

lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Experiment.php 1 location

@@ 161-168 (lines=8) @@
158
                case 'project_id': $this->setProjectId($value); break;
159
                case 'audience_ids': $this->setAudienceIds($value); break;
160
                case 'campaign_id': $this->setCampaignId($value); break;
161
                case 'changes': {
162
                    $changes = array();
163
                    foreach ($value as $changeInfo) {
164
                        $changes[] = new Change($changeInfo);
165
                    }
166
                    $this->setChanges($changes); 
167
                    break;
168
                }
169
                case 'created': $this->setCreated($value); break;    
170
                case 'description': $this->setDescription($value); break;    
171
                case 'holdback': $this->setHoldback($value); break;