Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 36-42 (lines=7) @@
33
    {
34
        foreach ($options as $name=>$value) {
35
            switch ($name) {                
36
                case 'changes': {
37
                    $changes = array();
38
                    foreach ($value as $changeInfo) {
39
                        $changes[] = new Change($changeInfo);
40
                    }
41
                    $this->setChanges($changes); break;
42
                }
43
                case 'page_id': $this->setPageId($value); break;
44
                default:
45
                    throw new Exception('Unknown option: ' . $name);

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

@@ 111-117 (lines=7) @@
108
        foreach ($options as $name=>$value) {
109
            switch ($name) {                
110
                case 'project_id': $this->setProjectId($value); break;
111
                case 'changes': {
112
                    $changes = array();
113
                    foreach ($value as $changeInfo) {
114
                        $changes[] = new Change($changeInfo);
115
                    }
116
                    $this->setChanges($changes); break;
117
                }
118
                case 'created': $this->setCreated($value); break;
119
                case 'earliest': $this->setEarliest($value); break;
120
                case 'experiment_ids': $this->setExperimentIds($value); break;