Code Duplication    Length = 21-21 lines in 2 locations

src/ReportingCloud.php 2 locations

@@ 129-149 (lines=21) @@
126
     *
127
     * @return array|null
128
     */
129
    public function getTemplateList()
130
    {
131
        $ret = null;
132
133
        $propertyMap = new TemplateListPropertyMap();
134
        $filter      = new DateTimeToTimestampFilter();
135
136
        $records = $this->get('/templates/list');
137
138
        if (is_array($records) && count($records) > 0) {
139
            $ret = $this->normalizeArrayKeys($records, $propertyMap);
140
            foreach ($ret as $index => $record) {
141
                $key = 'modified';
142
                if (isset($record[$key])) {
143
                    $ret[$index][$key] = $filter->filter($record[$key]);
144
                }
145
            }
146
        }
147
148
        return $ret;
149
    }
150
151
    /**
152
     * Return the number of pages in a template in template storage
@@ 196-216 (lines=21) @@
193
     *
194
     * @return array|null
195
     */
196
    public function getAccountSettings()
197
    {
198
        $ret = null;
199
200
        $propertyMap = new AccountSettingsPropertyMap();
201
        $filter      = new DateTimeToTimestampFilter();
202
203
        $records = $this->get('/account/settings');
204
205
        if (is_array($records) && count($records) > 0) {
206
            $ret = $this->normalizeArrayKeys($records, $propertyMap);
207
            foreach ($ret as $index => $record) {
208
                $key = 'valid_until';
209
                if (isset($record[$key])) {
210
                    $ret[$index][$key] = $filter->filter($record[$key]);
211
                }
212
            }
213
        }
214
215
        return $ret;
216
    }
217
218
    /**
219
     * Download the binary data of a template from template storage