Code Duplication    Length = 18-20 lines in 2 locations

src/ReportingCloud.php 2 locations

@@ 210-229 (lines=20) @@
207
     *
208
     * @return array|null
209
     */
210
    public function getTemplateList()
211
    {
212
        $ret = null;
213
214
        $propertyMap = new TemplateListPropertyMap();
215
216
        $records = $this->get('/templates/list');
217
218
        if (is_array($records) && count($records) > 0) {
219
            $ret = $this->buildPropertyMapArray($records, $propertyMap);
220
            array_walk($ret, function (&$record) {
221
                $key = 'modified';
222
                if (isset($record[$key])) {
223
                    $record[$key] = StaticFilter::execute($record[$key], 'DateTimeToTimestamp');
224
                }
225
            });
226
        }
227
228
        return $ret;
229
    }
230
231
    /**
232
     * Return the number of pages in a template in template storage
@@ 294-311 (lines=18) @@
291
     *
292
     * @return array|null
293
     */
294
    public function getAccountSettings()
295
    {
296
        $ret = null;
297
298
        $propertyMap = new AccountSettingsPropertyMap();
299
300
        $records = $this->get('/account/settings');
301
302
        if (is_array($records) && count($records) > 0) {
303
            $ret = $this->buildPropertyMapArray($records, $propertyMap);
304
            $key = 'valid_until';
305
            if ($ret[$key]) {
306
                $ret[$key] = StaticFilter::execute($ret[$key], 'DateTimeToTimestamp');
307
            }
308
        }
309
310
        return $ret;
311
    }
312
313
    /**
314
     * Download the binary data of a template from template storage