Code Duplication    Length = 28-29 lines in 3 locations

lib/Payone/Api/Request/Abstract.php 2 locations

@@ 176-203 (lines=28) @@
173
     * @param $name
174
     * @return null|mixed
175
     */
176
    public function get($name)
177
    {
178
        if (strpos($name, '/') !== false) {
179
            $explodedName = explode('/', $name);
180
            if (count($explodedName) != 2) {
181
                return null;
182
            }
183
184
            $property = $explodedName[0];
185
            $propertyName = $explodedName[1];
186
            if (property_exists($this, $property)) {
187
                $object = $this->$property;
188
                /**
189
                 * @var $object Payone_Api_Request_Parameter_Interface
190
                 */
191
                if (!($object instanceof Payone_Api_Request_Parameter_Interface)) {
192
                    return null;
193
                }
194
195
                return $object->get($propertyName);
196
            }
197
        }
198
        elseif (property_exists($this, $name)) {
199
            return $this->$name;
200
        }
201
202
        return null;
203
    }
204
205
    /**
206
     * @param string $name
@@ 210-238 (lines=29) @@
207
     * @param mixed $value
208
     * @return boolean|null
209
     */
210
    public function set($name, $value)
211
    {
212
        if (strpos($name, '/') !== false) {
213
            $explodedName = explode('/', $name);
214
            if (count($explodedName) != 2) {
215
                return null;
216
            }
217
218
            $property = $explodedName[0];
219
            $propertyName = $explodedName[1];
220
            if (property_exists($this, $property)) {
221
                $object = $this->$property;
222
                /**
223
                 * @var $object Payone_Api_Request_Parameter_Interface
224
                 */
225
                if (!($object instanceof Payone_Api_Request_Parameter_Interface)) {
226
                    return null;
227
                }
228
229
                return $object->set($propertyName, $value);
230
            }
231
        }
232
        elseif (property_exists($this, $name)) {
233
            $this->$name = $value;
234
            return true;
235
        }
236
237
        return null;
238
    }
239
240
    /**
241
     * @param string $encoding

lib/Payone/ClientApi/Request/Abstract.php 1 location

@@ 171-198 (lines=28) @@
168
     * @param $name
169
     * @return null|mixed
170
     */
171
    public function get($name)
172
    {
173
        if (strpos($name, '/') !== false) {
174
            $explodedName = explode('/', $name);
175
            if (count($explodedName) != 2) {
176
                return null;
177
            }
178
179
            $property = $explodedName[0];
180
            $propertyName = $explodedName[1];
181
            if (property_exists($this, $property)) {
182
                $object = $this->$property;
183
                /**
184
                 * @var $object Payone_Api_Request_Parameter_Interface
185
                 */
186
                if (!($object instanceof Payone_Api_Request_Parameter_Interface)) {
187
                    return null;
188
                }
189
190
                return $object->get($propertyName);
191
            }
192
        }
193
        elseif (property_exists($this, $name)) {
194
            return $this->$name;
195
        }
196
197
        return null;
198
    }
199
200
    /**
201
     * @param string $name