Code Duplication    Length = 10-14 lines in 3 locations

code/model/FoxyStripeClient.php 3 locations

@@ 138-147 (lines=10) @@
135
    /**
136
     * @param array $data
137
     */
138
    public function updateStore($data = []) {
139
        $client = $this->getClient();
140
        $errors = [];
141
        $result = $client->patch($this->getCurrentStore(), $data);
142
143
        $errors = array_merge($errors, $client->getErrors($result));
144
        if (count($errors)) {
145
            \SS_Log::log('updateStore errors - ' . json_encode($errors), \SS_Log::WARN);
146
        }
147
    }
148
149
    /**
150
     * @return mixed
@@ 187-199 (lines=13) @@
184
    /**
185
     *
186
     */
187
    public function setItemCategories()
188
    {
189
        $client = $this->getClient();
190
        $errors = [];
191
        $result = $client->get($this->getItemCategoriesURL());
192
193
        $this->item_categories = $result;
194
195
        $errors = array_merge($errors, $client->getErrors($result));
196
        if (count($errors)) {
197
            \SS_Log::log('setItemCategories errors - ' . json_encode($errors), \SS_Log::WARN);
198
        }
199
    }
200
201
    /**
202
     * @param $code
@@ 249-262 (lines=14) @@
246
    /**
247
     * @param array $data
248
     */
249
    public function deleteCategory($data = [])
250
    {
251
        $client = $this->getClient();
252
        $errors = [];
253
254
        if ($category = $this->getCategory($data['code'])) {
255
            $result = $client->delete($category);
256
257
            $errors = array_merge($errors, $client->getErrors($result));
258
            if (count($errors)) {
259
                \SS_Log::log('deleteCategory errors - ' . json_encode($errors), \SS_Log::WARN);
260
            }
261
        }
262
    }
263
}
264