Code Duplication    Length = 18-20 lines in 2 locations

src/ReportingCloud.php 2 locations

@@ 124-143 (lines=20) @@
121
     *
122
     * @return array|null
123
     */
124
    public function getTemplateList()
125
    {
126
        $ret = null;
127
128
        $propertyMap = new TemplateListPropertyMap();
129
130
        $records = $this->get('/templates/list');
131
132
        if (is_array($records) && count($records) > 0) {
133
            $ret = $this->buildPropertyMapArray($records, $propertyMap);
134
            array_walk($ret, function (&$record) {
135
                $key = 'modified';
136
                if (isset($record[$key])) {
137
                    $record[$key] = StaticFilter::execute($record[$key], 'DateTimeToTimestamp');
138
                }
139
            });
140
        }
141
142
        return $ret;
143
    }
144
145
    /**
146
     * Return the number of pages in a template in template storage
@@ 190-207 (lines=18) @@
187
     *
188
     * @return array|null
189
     */
190
    public function getAccountSettings()
191
    {
192
        $ret = null;
193
194
        $propertyMap = new AccountSettingsPropertyMap();
195
196
        $records = $this->get('/account/settings');
197
198
        if (is_array($records) && count($records) > 0) {
199
            $ret = $this->buildPropertyMapArray($records, $propertyMap);
200
            $key = 'valid_until';
201
            if ($ret[$key]) {
202
                $ret[$key] = StaticFilter::execute($ret[$key], 'DateTimeToTimestamp');
203
            }
204
        }
205
206
        return $ret;
207
    }
208
209
    /**
210
     * Download the binary data of a template from template storage