Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 107-129 (lines=23) @@
104
    /**
105
     * Constructor.
106
     */
107
    public function __construct($options = array())
108
    {
109
        foreach ($options as $name=>$value) {
110
            switch ($name) {                
111
                case 'api_name': $this->setApiName($value); break;
112
                case 'archived': $this->setArchived($value); break;
113
                case 'category': $this->setCategory($value); break;
114
                case 'created': $this->setCreated($value); break;
115
                case 'description': $this->setDescription($value); break;
116
                case 'event_filter': $this->setEventFilter(new EventFilter($value)); break;
117
                case 'event_type': $this->setEventType($value); break;
118
                case 'key': $this->setKey($value); break;
119
                case 'name': $this->setName($value); break;
120
                case 'page_id': $this->setPageId($value); break;
121
                case 'project_id': $this->setProjectId($value); break;
122
                case 'id': $this->setId($value); break;
123
                case 'is_classic': $this->setIsClassic($value); break;
124
                case 'is_editable': $this->setIsEditable($value); break;
125
                default:
126
                    throw new \Exception('Unknown option: ' . $name);
127
            }
128
        }
129
    }
130
    
131
    /**
132
     * Returns this object as array.

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

@@ 102-124 (lines=23) @@
99
    /**
100
     * Constructor.
101
     */
102
    public function __construct($options = array())
103
    {
104
        foreach ($options as $name=>$value) {
105
            switch ($name) {                
106
                case 'edit_url': $this->setEditUrl($value); break;
107
                case 'name': $this->setName($value); break;    
108
                case 'project_id': $this->setProjectId($value); break;
109
                case 'activation_code': $this->setActivationCode($value); break;
110
                case 'activation_type': $this->setActivationType($value); break;
111
                case 'api_name': $this->setApiName($value); break;
112
                case 'archived': $this->setArchived($value); break;
113
                case 'category': $this->setCategory($value); break;
114
                case 'conditions': $this->setConditions($value); break;
115
                case 'key': $this->setKey($value); break;
116
                case 'page_type': $this->setPageType($value); break;                
117
                case 'created': $this->setCreated($value); break;
118
                case 'id': $this->setId($value); break;
119
                case 'last_modified': $this->setLastModified($value); break;
120
                default:
121
                    throw new \Exception('Unknown option: ' . $name);
122
            }
123
        }
124
    }
125
    
126
    /**
127
     * Returns this object as array.