Code Duplication    Length = 21-21 lines in 2 locations

src/ReportingCloud.php 2 locations

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