Code Duplication    Length = 18-20 lines in 2 locations

src/GetTrait.php 2 locations

@@ 224-243 (lines=20) @@
221
     *
222
     * @return array|null
223
     */
224
    public function getTemplateList()
225
    {
226
        $ret = null;
227
228
        $propertyMap = new TemplateListPropertyMap();
229
230
        $records = $this->get('/templates/list');
231
232
        if (is_array($records) && count($records) > 0) {
233
            $ret = $this->buildPropertyMapArray($records, $propertyMap);
234
            array_walk($ret, function (&$record) {
235
                $key = 'modified';
236
                if (isset($record[$key])) {
237
                    $record[$key] = StaticFilter::execute($record[$key], 'DateTimeToTimestamp');
238
                }
239
            });
240
        }
241
242
        return $ret;
243
    }
244
245
    /**
246
     * Return the number of pages in a template in template storage
@@ 309-326 (lines=18) @@
306
     * @return null
307
     * @throws \Zend\Filter\Exception\ExceptionInterface
308
     */
309
    public function getAccountSettings()
310
    {
311
        $ret = null;
312
313
        $propertyMap = new AccountSettingsPropertyMap();
314
315
        $records = $this->get('/account/settings');
316
317
        if (is_array($records) && count($records) > 0) {
318
            $ret = $this->buildPropertyMapArray($records, $propertyMap);
319
            $key = 'valid_until';
320
            if ($ret[$key]) {
321
                $ret[$key] = StaticFilter::execute($ret[$key], 'DateTimeToTimestamp');
322
            }
323
        }
324
325
        return $ret;
326
    }
327
328
    /**
329
     * Download the binary data of a template from template storage